RabbitMq.php
/**
     * Consumes messages and sends them to callback
     * @param callable $callback
     * @param int $timeout time in second after which script will stop waiting for messages and exits
     */
Consumes messages and sends them to callback
@param callable $callback
@param int $timeout time in second after which script will stop waiting for messages and exits
Consumes messages and sends them to callback @param callable $callback @param int $timeout time in second after which script will stop waiting for messages and exits
public function consume($callback, $timeout = 0)
    {
        try {
            $this->channel->basic_qos(null, 1, null);
            $this->channel->basic_consume($this->queue, '', false, false, false, false, $callback);
            while(count($this->channel->callbacks)) {
                $this->channel->wait(null, false, $timeout);
            }
        } catch (PhpAmqpLib\Exception\AMQPTimeoutException $e) {
        }
    }
public function consume ( $ callback , $ timeout = 0 ) { try { $ this -> channel -> basic_qos ( null , 1 , null ) ; $ this -> channel -> basic_consume ( $ this -> queue , '' , false , false , false , false , $ callback ) ; while ( count ( $ this -> channel -> callbacks ) ) { $ this -> channel -> wait ( null , false , $ timeout ) ; } } catch ( PhpAmqpLib \ Exception \ AMQPTimeoutException $ e ) { } }
Consumes messages and sends them to callback
 @param callable $callback
 @param int $timeout time in second after which script will stop waiting for messages and exits
Consumes messages and sends them to callback @param callable $callback @param int $timeout time in second after which script will stop waiting for messages and exits