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
.
제휴하지 않습니다 StackOverflow