library/AbstractWorkerController.php
public function receive(QueueClientInterface $queue, $maxMessages = 1, ReceiveParametersInterface $params = null)
    {
        $messages = $queue->receive($maxMessages, $params);
        $lastResult = [];

        foreach ($messages as $message) {
            if ($message instanceof MessageInterface) {

                $lastResult = $this->process($message);

                if ($queue->canDeleteMessage()) {
                    $queue->delete($message);
                }
            }
            // TODO: else?
        }

        return $lastResult;
    }
public function receive(QueueClientInterface $queue, $maxMessages = 1, ReceiveParametersInterface $params = null)
    {
        $messages = $queue->receive($maxMessages, $params);
        $lastResult = [];

        foreach ($messages as $message) {
            if ($message instanceof MessageInterface) {

                $lastResult = $this->process($message);

                if ($queue->canDeleteMessage()) {
                    $queue->delete($message);
                }
            }
            // TODO: else?
        }

        return $lastResult;
    }
public function receive ( QueueClientInterface $ queue , $ maxMessages = 1 , ReceiveParametersInterface $ params = null ) { $ messages = $ queue -> receive ( $ maxMessages , $ params ) ; $ lastResult = [ ] ; foreach ( $ messages as $ message ) { if ( $ message instanceof MessageInterface ) { $ lastResult = $ this -> process ( $ message ) ; if ( $ queue -> canDeleteMessage ( ) ) { $ queue -> delete ( $ message ) ; } } // TODO: else? } return $ lastResult ; }
Receive and process one or more incoming messages

@param QueueClientInterface $queue
@param int $maxMessages
@param ReceiveParametersInterface $params
@return mixed
Receive and process one or more incoming messages