Given this line of code to callback a function and the callback function itself:
Class MyClass {
public function doThings() {
$this->gearman->client->setCompleteCallback("workerCompleted");
}
public function workerCompleted() {
echo "worker is completed!";
}
}
I get Message: GearmanClient::setCompleteCallback(): function workerCompleted is not callable
The setCompleteCallback
method expects a function name in quotations, but how do I call a class method? $this->"workerCompleted"
obviously is wrong.