MGDigital\BusQue\Redis\RedisDriver::awaitCommand PHP Метод

awaitCommand() публичный Метод

public awaitCommand ( string $queueName, integer $time = null ) : ReceivedCommand
$queueName string
$time integer
Результат MGDigital\BusQue\ReceivedCommand
    public function awaitCommand(string $queueName, int $time = null) : ReceivedCommand
    {
        $id = $this->adapter->bRPopLPush("{$this->namespace}:{$queueName}:queue", "{$this->namespace}:{$queueName}:receiving", $time ?? 0);
        if (empty($id)) {
            throw new TimeoutException();
        }
        $serialized = $this->evalScript('receive_message', [$this->namespace, $queueName, $id]);
        if (empty($serialized)) {
            throw new ConcurrencyException(sprintf('Cannot currently receive command %s.', $id));
        }
        return new ReceivedCommand($queueName, $id, $serialized);
    }