GearmanBundle
GearmanBundle copied to clipboard
Cli features
Hello,
Is there a way to get the queue length? Indeed, I run the method doBackgroundJob when I want to execute an action but I got a problem if the worker isn't launched : my queue increases without any reason. So I'd like to know the queue length in order to avoid useless doBackgroundJob.
Thanks for the answer
nc <hostname> 4730
status
Or write a script to do that, or use a persistent store (sqlite, drizzle, etc.) and do a count on the number of rows.
thanks for the comment, I got another question: when I run
nc localhost 4730
status
I got something like this
worker ~ function 184 0 0
Is there a way or command to reset the queue?
"184" is number of jobs queued, "0" is number of jobs processing, the final "0" is number of workers connected that can process that job.
To clear the queue, you can just restart gearmand.
There's also a 'gearman' command you can install (e.g., on ubuntu) that provides some utilities.
Leaving this open as things like this could make for a handy CLI tool.
Could be nice, with this new version, add some new cli features.
Any ideas?