给定这行代码来回调一个函数和回调函数本身:
Class MyClass {
public function doThings() {
$this->gearman->client->setCompleteCallback("workerCompleted");
}
public function workerCompleted() {
echo "worker is completed!";
}
}
我明白了Message: GearmanClient::setCompleteCallback(): function workerCompleted is not callable
该setCompleteCallback
方法需要引号中的函数名称,但是如何调用类方法?$this->"workerCompleted"
显然是错误的。