public static function fromId($id, Logger $logger = null)
    {
        if (!$id or !count($packet = Redis::instance()->hgetall(self::redisKey($id)))) {
            return false;
        }

        $worker = new static(explode(',', $packet['queues']), $packet['blocking']);
        $worker->setId($id);
        $worker->setPid($packet['pid']);
        $worker->setInterval($packet['interval']);
        $worker->setTimeout($packet['timeout']);
        $worker->setMemoryLimit($packet['memory_limit']);
        $worker->setHost(new Host($packet['hostname']));
        $worker->shutdown = isset($packet['shutdown']) ? $packet['shutdown'] : null;
        $worker->setLogger($logger);

        return $worker;
    }
public static function fromId($id, Logger $logger = null)
    {
        if (!$id or !count($packet = Redis::instance()->hgetall(self::redisKey($id)))) {
            return false;
        }

        $worker = new static(explode(',', $packet['queues']), $packet['blocking']);
        $worker->setId($id);
        $worker->setPid($packet['pid']);
        $worker->setInterval($packet['interval']);
        $worker->setTimeout($packet['timeout']);
        $worker->setMemoryLimit($packet['memory_limit']);
        $worker->setHost(new Host($packet['hostname']));
        $worker->shutdown = isset($packet['shutdown']) ? $packet['shutdown'] : null;
        $worker->setLogger($logger);

        return $worker;
    }
public static function fromId ( $ id , Logger $ logger = null ) { if ( ! $ id or ! count ( $ packet = Redis :: instance ( ) -> hgetall ( self :: redisKey ( $ id ) ) ) ) { return false ; } $ worker = new static ( explode ( ',' , $ packet [ 'queues' ] ) , $ packet [ 'blocking' ] ) ; $ worker -> setId ( $ id ) ; $ worker -> setPid ( $ packet [ 'pid' ] ) ; $ worker -> setInterval ( $ packet [ 'interval' ] ) ; $ worker -> setTimeout ( $ packet [ 'timeout' ] ) ; $ worker -> setMemoryLimit ( $ packet [ 'memory_limit' ] ) ; $ worker -> setHost ( new Host ( $ packet [ 'hostname' ] ) ) ; $ worker -> shutdown = isset ( $ packet [ 'shutdown' ] ) ? $ packet [ 'shutdown' ] : null ; $ worker -> setLogger ( $ logger ) ; return $ worker ; }
Return a worker from it's ID

@param  string $id     Worker id
@param  Logger $logger Logger for the worker to use
@return Worker
Return a worker from it s ID