tags:

views:

17

answers:

1

I have a number of gearman clients sending a job, say job1.

$client = new GearmanClient();
$client->addServer();
$client->doBackground('job1', 'workload');

It takes, say 10 seconds to process this job. I want to track how many 'job1' jobs are waiting for a worker to work on them at any given time. How can I do that?

A: 

It doesn't look like there are any immediate ways to get this information.

Here are a few options. First, if you can grab job handles as you create them (search for "Speaking of checking the status"), you can store them away in some central place and query about them from any client.

Second, you can set your Gearman server to use persistent queues, and then run a query against the queue yourself. This might be the easier and cleaner of the two options.

Charles