GearmanManager in background
We were using Gearman/PHP on Ubuntu to delegate our processes. On this (development) machine we were opening few terminal windows to start clients and workers respectively, but now on live machine we need to send our clients and workers into background so that we have our terminal free.
We found brianlmoon's GearmanManager. It looks exactly what we need, but the problem is that in its code we were only able to find the part of sending wo开发者_开发技巧rkers into background and nothing about doing the same with the clients.
Could someone give us more inputs how to send all client/server processes into background using GearmanManager?
GearmanManager is only concerned with workers. You don't "send" clients into the background. Clients can submit jobs as background jobs. Assuming that is what you want to do and you are using the PECL library, the GearmanClient->doBackground() method is what you want.
PHP's Gearman PECL extension is what you should be invoking: http://php.net/gearman When you want to send the client processes into the background, you'd just use the GearmanClient->doBackground method. Then the client can either proceed with other tasks or exit. Otherwise when the client must wait for the task to complete, you want the GearmanClient->do method.
精彩评论