문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top