Is it possible to idle the Client when all workers are working?
I have the following case:
$client= new GearmanClient();
$client->addServer();
$data = array(thousands of entries);
foreach($data as $dt) {
$client->doBackground('doFancy', $dt);
}
When I run this, it will make thousands of queues or even overload the memory.
Is it possible to wait for a worker to become free until the foreach loop continues assigning new jobs?