From manual page: https://php.net/gearmanclient.setcompletecallback
It should be noted that:
All the GearmanClient::setXXXCallback(...) methods (like GearmanClient::setCompleteCallback(...)) need to be called before calling some GearmanClient::addTaskXXX(...) method (like GearmanClient::addTask(...)). Setting the callback before calling GearmanClient::runTasks() is not sufficient.
Sounds stupid but such things just cost time.
From manual page: https://php.net/gearmanclient.setcompletecallback
It should be noted that:
All the
GearmanClient::setXXXCallback(...)methods (likeGearmanClient::setCompleteCallback(...)) need to be called before calling someGearmanClient::addTaskXXX(...)method (likeGearmanClient::addTask(...)). Setting the callback before callingGearmanClient::runTasks()is not sufficient.Sounds stupid but such things just cost time.