Is it possible to empty a job queue on a Gearman server

daniyalzade picture daniyalzade · Dec 22, 2010 · Viewed 10.7k times · Source

Is it possible to empty a job queue on a Gearman server? I am using the python driver for Gearman, and the documentation does not have any information about emptying queues. I would imagine that this functionality should exist, possibly, with a direct connection to the Gearman server.

Answer

Gary Richardson picture Gary Richardson · Sep 18, 2012

I came across this method:

/usr/bin/gearman -t 1000 -n -w -f function_name > /dev/null

which basically dumps all the jobs into /dev/null.