yii - Start and stopping workers in gearman php -


I have successfully configured and used Gearman and its pecl php extension. I'm using it to perform a long process in a background about long SQL queries. I am using Yeti Beat, if this explanation helps.

How it is used here:

  Public function function process specialist () {$ output = shell_exec ('gnome-terminal -e' php workers / worker.php " & Gt; / dev / null 2 ​​& gt; / dev / null & amp; ';); $ Client = new gearman client (); $ Customer & gt; AddServer (); $ Result = $ client- & gt; DoBackground ('executeJob', // parameter); }   

Some details:

If you believe that I gnome-terminal php command , I / dev / null so that it will not wait for a response now. And then the worker is awake and runs the job.

Problem:

This action occurs when this operation is performed multiple times or executed by many users in different clients. , and as a result, many terminals running worker.php are being given instantaneously.

How can I do only one worker and even if I find several employees for different users in different clients, then I How can I stop a worker every time?

You can try adding the return code () and jobstat ().

Here's a sample -


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -