GearmanManager in the background

We used Gearman / PHP on Ubuntu to delegate our processes. On this (developing) machine, we opened several terminal windows for launching clients and workers, respectively, but now on a live machine we need to send our clients and workers to the background so that we have a free terminal.

We found brianlmoon GearmanManager. It looks exactly the way we need it, but the problem is that in its code we could find a part of sending workers in the background and do nothing with clients.

Can someone give us more information on how to send all client / server processes in the background using GearmanManager?

+4
source share
2 answers

The PHP Gearman PECL extension is what you should call: http://php.net/gearman When you want to send client processes to the background, you simply use the GearmanClient-> doBackground method. Then the client can either continue to perform other tasks or exit. Otherwise, when the client needs to wait for the task to complete, you need the GearmanClient-> do method.

+1
source

GearmanManager only deals with employees. You do not send clients in the background. Customers can submit jobs as background jobs. Assuming this is what you want to do and you are using the PECL library, the GearmanClient-> doBackground () method is what you want.

+2
source

All Articles