当前位置: 动力学知识库 > 问答 > 编程问答 >

The Gearman Worker PHP file saved where exactly?

问题描述:

If you have a Gearman worker server and you have a Worker.php file, i.e.

 <?php

$worker = new GearmanWorker();

$worker->addServer('...');

$worker->addFunction("customFunction", "my_custom_function");

while ($worker->work());

function my_custom_function($job)

{

return doStuff($job->workload());

}

?>

Where does this file go? Does it go on the actual worker server and every worker server that you want to handle this type of job or what? Simple question. I just don't know the answer.

网友答案:

Yes. The worker machine becomes a worker machine by running this script. To run this script you need to put it on the machine and execute it, likely from the command line using php Worker.php.

分享给朋友:
您可能感兴趣的文章:
随机阅读: