"Warning: GearmanClient::runTasks(): Could not call the function in ..." 消息的原因是什么?

What causes the "Warning: GearmanClient::runTasks(): Could not call the function in ..." message?

通过几位工作人员,我开始使用 Gearman 完成 运行 任务。我收到以下消息:

警告:GearmanClient::runTasks():无法在第 192 行调用 ....php 中的函数。

第 192 行包含以下内容: class 客户端扩展 \GearmanClient { //... $this->setCompleteCallback(...); $this->addTast(...); //... $this->addTast(...); $this->runTasks(); // 这是第 192 行 //... }

出现此消息的原因是什么?

经过一番调查,发现是当工作人员完成任务时调用的回调函数导致了问题。

如果回调函数抛出异常,则会导致上述消息。

解决办法是改回调函数,就是收集每个worker的结果。现在,它不再抛出异常,而是将问题的描述存储在结果列表中。