Calls basic.get AMQP method.

@param string $queue
@param boolean $noAck

@return boolean|Promise\PromiseInterface|Protocol\MethodBasicGetOkFrame|Protocol\MethodBasicGetEmptyFrame
348846
public function get($queue = '', $noAck = false)
    {
        return $this->getClient()->get($this->getChannelId(), $queue, $noAck);
    }
1093429
public function queuePurge($queue = '', $nowait = false)
    {
        return $this->getClient()->queuePurge($this->getChannelId(), $queue, $nowait);
    }
913486
protected function getNextJob( $connection, $queue )
	{
		if ( is_null( $queue ) )
			return $connection->pop();

		foreach ( explode( ',', $queue ) as $queue )
			if ( !is_null( $job = $connection->pop( $queue ) ) )
				return $job;

		return null;
	}
320161
public function pop($queue = null)
    {
        $this->migrate($prefixed = $this->getQueue($queue));

        if (empty($nextJob = $this->retrieveNextJob($prefixed))) {
            return;
        }

        [$job, $reserved] = $nextJob;

        if ($reserved) {
            return new RedisJob(
                $this->container, $this, $job,
                $reserved, $this->connectionName, $queue ?: $this->default
            );
        }
    }
861818
public function pop($queue = null)
    {
        $queue = $this->getQueue($queue);

        return $this->database->transaction(function () use ($queue) {
            if ($job = $this->getNextAvailableJob($queue)) {
                return $this->marshalJob($queue, $job);
            }
        });
    }
272237
private function receiveQueueMessages(Queue $queue, $max, $timeout)
    {
        $messages      = array();
        $microtime = microtime(true); // cache microtime
        $db        = $this->getDb();
        $qid       = $this->getQueueId($queue->getName());
        
        // start transaction handling
        try {
            if ( $max > 0 ) {
                $db->beginTransaction();

                $sql = "SELECT *
                        FROM " . $this->messageTable . "
                        WHERE queue_id = :queue_id
                        AND (handle IS NULL OR timeout+" . (int)$timeout . " < " . (int)$microtime .")
                        LIMIT ".$max;
                $stmt = $db->prepare($sql);
                $stmt->execute(array('queue_id'=>$qid));

                foreach ($stmt->fetchAll() as $data) {
                    $data['handle'] = md5(uniqid(rand(), true));

                    $sql = "UPDATE " . $this->messageTable . "
                            SET
                                handle = :handle,
                                timeout = :timeout
                            WHERE
                                message_id = :id
                                AND (handle IS NULL OR timeout+" . (int)$timeout . " < " . (int)$microtime.")";

                    $stmt = $db->prepare($sql);
                    $stmt->bindParam(':handle', $data['handle'], \PDO::PARAM_STR);
                    $stmt->bindParam(':id', $data['message_id'], \PDO::PARAM_STR);
                    $stmt->bindValue(':timeout', $microtime);
                    $updated = $stmt->execute();
                    
                    if ($updated) {
                        $messages[] = $data;
                    }
                }
                $db->commit();
            }
        } catch (\Exception $e) {
            $db->rollBack();
            throw $e;
        }
        
        $m = array();
        foreach($messages as $msg) {
            $message = unserialize(base64_decode($msg['body']));
            if($message instanceof Message) {
                $message->message_id = $msg['message_id'];
                $m[] = $message;
            }
        }

        return new \ArrayObject($m);
    }
876775
public function consume(callable $callback, $autoAck = 1)
    {
        if ($autoAck) {
            $this->amqpQueue->consume($callback, AMQP_AUTOACK);
        } else {
            $this->amqpQueue->consume($callback);
        }
    }
1154880
public function queue(Queue $queue)
    {
        if (isset($this->delay)) {
            return $this->later($this->delay, $queue);
        }

        $connection = property_exists($this, 'connection') ? $this->connection : null;

        $queueName = property_exists($this, 'queue') ? $this->queue : null;

        return $queue->connection($connection)->pushOn(
            $queueName ?: null, new SendQueuedMailable($this)
        );
    }
769399
public function get(string $queue = 'default', $isAck = true)
    {
        /** @var \AMQPEnvelope $AMQPEnvelope */
        $AMQPEnvelope = yield $this->rabbit->get($isAck);
        if ($AMQPEnvelope !== false) {
            if ($isAck == false) {
                $this->deliveryTag = $AMQPEnvelope->getDeliveryTag();
            }
            return $AMQPEnvelope->getBody();
        }
        return false;
    }
1092604
protected function retrieveNextJob($queue)
    {
        return $this->getConnection()->eval(
            LuaScripts::pop(), 2, $queue, $queue.':reserved',
            $this->availableAt($this->retryAfter)
        );
    }
587919
public function get($queueName)
    {
        if (! is_null($this->expire) )
        {
            $this->migrateAllExpiredJobs($queueName);
        }

        $objectReids = $this->__handler;
        $objectReids->loadScripts('queueGet');

        $queueData = $objectReids->queueGet($queueName, $queueName.':reserved', time() + $this->expire);

        if( ! is_null($queueData) )
        {
            return new system_queue_message_redis($queueData);
        }

        return false;
    }
681849
public function pop($queue = null)
    {
        $queue = $queue ? $queue : $this->default;

        $this->database->beginTransaction();

        $query = Job::on($this->database->getName() )
            ->where('timestamp', '<', date('Y-m-d H:i:s', time()))
            ->where('queue', '=', $queue)
            ->where(function (Builder $query) {
                $query->where('status', '=', Job::STATUS_OPEN);
                $query->orWhere('status', '=', Job::STATUS_WAITING);
            })
            ->orderBy('id')
            ;
        // If requested set pessimistic lock
        if ($this->lock_type==self::LOCK_TYPE_SHARED) {
            $query->sharedLock();
        } elseif ($this->lock_type==self::LOCK_TYPE_FOR_UPDATE) {
            $query->lockForUpdate();
        }
        $job = $query->first();

        if (! is_null($job)) {
            // Mark job as started
            $job->status = Job::STATUS_STARTED;
            $job->save();

            $this->database->commit();
            $dbJob = new DatabaseJob($this->container, $job, $queue);
            return $dbJob;
        }
        else {
            $this->database->rollBack();
            return null;
        }
    }
372746
public function getMessage($queue, $auto_ack = false)
    {
        if (!isset($this->_queues[$queue])) {
            throw new InvalidKeyException(['retrieve message from queue failed: `:queue` queue is NOT exists`', 'queue' => $queue]);
        }

        try {
            $envelope = $this->_queues[$queue]->get($auto_ack ? AMQP_AUTOACK : AMQP_NOPARAM);
        } catch (\Exception $e) {
            throw new AmqpException(['retrieve message from `:queue` queue failed: :error ', 'queue' => $queue, 'error' => $e->getMessage()]);
        }

        return $envelope === false ? false : new Message($this, $queue, $envelope);
    }
1166680
public function createMessage($message, $queueId)
    {
        $queueMessage = new QueueMessage();
        $queueMessage->setMessage($message);
        $queueMessage->setQueueId($queueId);
        return $queueMessage;
    }
955771
public function get(string $queueName): ?\AMQPEnvelope
    {
        if ($this->shouldSetup()) {
            $this->setup();
        }

        try {
            if (false !== $message = $this->queue($queueName)->get()) {
                return $message;
            }
        } catch (\AMQPQueueException $e) {
            if (404 === $e->getCode() && $this->shouldSetup()) {
                // If we get a 404 for the queue, it means we need to setup the exchange & queue.
                $this->setup();

                return $this->get();
            }

            throw $e;
        }

        return null;
    }
788331
public function pushToQueue($queue, $message)
    {
        $message = $message instanceof AMQPMessage
            ? $message
            : new AMQPMessage($message);

        $this->getChannel()->queue_declare($queue);
        $this->getChannel()->basic_publish($message, '', $queue);
    }
81211
protected function getQueue($queue)
    {
        if (is_array($queue)) {
            if (count($queue) > 1) {
                $queues = array_map([$this->queues, 'create'], $queue);

                return new RoundRobinQueue($queues);
            }

            $queue = $queue[0];
        }

        return $this->queues->create($queue);
    }