PhpAmqpLib/Channel/AMQPChannel.php
public function basic_consume(
        $queue = '',
        $consumer_tag = '',
        $no_local = false,
        $no_ack = false,
        $exclusive = false,
        $nowait = false,
        $callback = null,
        $ticket = null,
        $arguments = array()
    ) {
        $ticket = $this->getTicket($ticket);
        list($class_id, $method_id, $args) = $this->protocolWriter->basicConsume(
            $ticket,
            $queue,
            $consumer_tag,
            $no_local,
            $no_ack,
            $exclusive,
            $nowait,
            $this->protocolVersion == '0.9.1' ? $arguments : null
        );

        $this->send_method_frame(array($class_id, $method_id), $args);

        if (false === $nowait) {
            $consumer_tag = $this->wait(array(
                $this->waitHelper->get_wait('basic.consume_ok')
            ), false, $this->channel_rpc_timeout);
        }

        $this->callbacks[$consumer_tag] = $callback;

        return $consumer_tag;
    }
public function basic_consume(
        $queue = '',
        $consumer_tag = '',
        $no_local = false,
        $no_ack = false,
        $exclusive = false,
        $nowait = false,
        $callback = null,
        $ticket = null,
        $arguments = array()
    ) {
        $ticket = $this->getTicket($ticket);
        list($class_id, $method_id, $args) = $this->protocolWriter->basicConsume(
            $ticket,
            $queue,
            $consumer_tag,
            $no_local,
            $no_ack,
            $exclusive,
            $nowait,
            $this->protocolVersion == '0.9.1' ? $arguments : null
        );

        $this->send_method_frame(array($class_id, $method_id), $args);

        if (false === $nowait) {
            $consumer_tag = $this->wait(array(
                $this->waitHelper->get_wait('basic.consume_ok')
            ), false, $this->channel_rpc_timeout);
        }

        $this->callbacks[$consumer_tag] = $callback;

        return $consumer_tag;
    }
public function basic_consume ( $ queue = '' , $ consumer_tag = '' , $ no_local = false , $ no_ack = false , $ exclusive = false , $ nowait = false , $ callback = null , $ ticket = null , $ arguments = array ( ) ) { $ ticket = $ this -> getTicket ( $ ticket ) ; list ( $ class_id , $ method_id , $ args ) = $ this -> protocolWriter -> basicConsume ( $ ticket , $ queue , $ consumer_tag , $ no_local , $ no_ack , $ exclusive , $ nowait , $ this -> protocolVersion == '0.9.1' ? $ arguments : null ) ; $ this -> send_method_frame ( array ( $ class_id , $ method_id ) , $ args ) ; if ( false === $ nowait ) { $ consumer_tag = $ this -> wait ( array ( $ this -> waitHelper -> get_wait ( 'basic.consume_ok' ) ) , false , $ this -> channel_rpc_timeout ) ; } $ this -> callbacks [ $ consumer_tag ] = $ callback ; return $ consumer_tag ; }
Starts a queue consumer

@param string $queue
@param string $consumer_tag
@param bool $no_local
@param bool $no_ack
@param bool $exclusive
@param bool $nowait
@param callable|null $callback
@param int|null $ticket
@param array $arguments
@throws \PhpAmqpLib\Exception\AMQPTimeoutException if the specified operation timeout was exceeded
@return mixed|string
Starts a queue consumer