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

        $result = [];
        while ($envelop = $queue->get()) {
            $queue->ack($envelop->getDeliveryTag());
            $result[] = $envelop;
        }

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

        $result = [];
        while ($envelop = $queue->get()) {
            $queue->ack($envelop->getDeliveryTag());
            $result[] = $envelop;
        }

        return $result;
    }
public function readAll ( $ chat , $ route , $ nameReader ) { $ queue = new \ AMQPQueue ( $ this -> channel ) ; $ queue -> setName ( $ nameReader ) ; /** @noinspection PhpUndefinedMethodInspection */ $ queue -> declare ( ) ; $ queue -> bind ( $ chat , $ route ) ; $ result = [ ] ; while ( $ envelop = $ queue -> get ( ) ) { $ queue -> ack ( $ envelop -> getDeliveryTag ( ) ) ; $ result [ ] = $ envelop ; } return $ result ; }
Read all messages

@access public

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

@return array
@throws \AMQPConnectionException
@throws \AMQPQueueException
@throws \AMQPChannelException
Read all messages