Amit, kosta250
I found a workaround to avoid the dead servers and continue with rest alive.
<?php
$servers = array(
array('host' => '127.0.0.1', 'port' => '4730'),
array('host' => '127.0.0.1', 'port' => '4731'),
array('host' => '127.0.0.1', 'port' => '4732'),
array('host' => '127.0.0.2', 'port' => '4730')
);
$client= new \GearmanClient();
foreach($servers as $server) {
$c = new \GearmanClient();
$c->addServer($server['host'], $server['port']);
if (@$c->ping('ping')) {
$client->addServer($server['host'], $server['port']);
}
}
?>