public function pruneDeadWorkers()
{
$workerPids = $this->workerPids();
$workers = self::all();
foreach ($workers as $worker) {
if (is_object($worker)) {
list($host, $pid, $queues) = explode(':', (string) $worker, 3);
if ($host != $this->hostname || in_array($pid, $workerPids) || $pid == getmypid()) {
continue;
}
$this->logger->log(Psr\Log\LogLevel::INFO, 'Pruning dead worker: {worker}', array('worker' => (string) $worker));
$worker->unregisterWorker();
}
}
}