src/queue/drivers/RabbitMQ.php
public function read($chat, $route, $nameReader = 'random')
    {
        $queue = new \AMQPQueue($this->channel);
        $queue->setName($nameReader);
        /** @noinspection PhpUndefinedMethodInspection */
        $queue->declare();
        $queue->bind($chat, $route);

        $envelop = $queue->get();
        if ($envelop) {
            $queue->ack($envelop->getDeliveryTag());

            return $envelop;
        }

        return false;
    }
public function read($chat, $route, $nameReader = 'random')
    {
        $queue = new \AMQPQueue($this->channel);
        $queue->setName($nameReader);
        /** @noinspection PhpUndefinedMethodInspection */
        $queue->declare();
        $queue->bind($chat, $route);

        $envelop = $queue->get();
        if ($envelop) {
            $queue->ack($envelop->getDeliveryTag());

            return $envelop;
        }

        return false;
    }
public function read ( $ chat , $ route , $ nameReader = 'random' ) { $ queue = new \ AMQPQueue ( $ this -> channel ) ; $ queue -> setName ( $ nameReader ) ; /** @noinspection PhpUndefinedMethodInspection */ $ queue -> declare ( ) ; $ queue -> bind ( $ chat , $ route ) ; $ envelop = $ queue -> get ( ) ; if ( $ envelop ) { $ queue -> ack ( $ envelop -> getDeliveryTag ( ) ) ; return $ envelop ; } return false ; }
Read current message

@access public

@param string $chat name chat room
@param string $route name route
@param string $nameReader name queue

@return \AMQPEnvelope|bool
@throws \AMQPConnectionException
@throws \AMQPChannelException
@throws \AMQPQueueException
Read current message