protected function doPop()
    {
        // ensures that the SQS Queue exist
        if (!$this->queueExists()) {
            $this->createQueue();
        }

        $logContext = [
            'QueueUrl' => $this->queueUrl
        ];

        try {
            $result = $this->getClient()->receiveMessage([
                'AttributeNames' => [], //nothing
                'MaxNumberOfMessages' => $this->getNumberOfTasksToReceive(),
                'MessageAttributeNames' => [], //nothing
                'QueueUrl' => $this->queueUrl,
                'WaitTimeSeconds' => 20 //retrieving messages with Long Polling
            ]);

            if (count($result->get('Messages')) > 0) {
                $this->logDebug('Received '. count($result->get('Messages')) .' messages.', $logContext);

                foreach ($result->get('Messages') as $message) {
                    $task = $this->unserializeTask($message['Body'], $message['ReceiptHandle'], [
                        'SqsMessageId' => $message['MessageId']
                    ]);

                    if ($task) {
                        $task->setMetadata('SqsMessageId', $message['MessageId']);
                        $task->setMetadata('ReceiptHandle', $message['ReceiptHandle']);
                        $this->pushPreFetchedMessage($task);
                    }
                }
            } else {
                $this->logDebug('No messages in queue.', $logContext);
            }
        } catch (AwsException $e) {
            $this->logError('Popping tasks failed with MSG: '. $e->getAwsErrorMessage(), $logContext);
        }
    }
protected function doPop()
    {
        // ensures that the SQS Queue exist
        if (!$this->queueExists()) {
            $this->createQueue();
        }

        $logContext = [
            'QueueUrl' => $this->queueUrl
        ];

        try {
            $result = $this->getClient()->receiveMessage([
                'AttributeNames' => [], //nothing
                'MaxNumberOfMessages' => $this->getNumberOfTasksToReceive(),
                'MessageAttributeNames' => [], //nothing
                'QueueUrl' => $this->queueUrl,
                'WaitTimeSeconds' => 20 //retrieving messages with Long Polling
            ]);

            if (count($result->get('Messages')) > 0) {
                $this->logDebug('Received '. count($result->get('Messages')) .' messages.', $logContext);

                foreach ($result->get('Messages') as $message) {
                    $task = $this->unserializeTask($message['Body'], $message['ReceiptHandle'], [
                        'SqsMessageId' => $message['MessageId']
                    ]);

                    if ($task) {
                        $task->setMetadata('SqsMessageId', $message['MessageId']);
                        $task->setMetadata('ReceiptHandle', $message['ReceiptHandle']);
                        $this->pushPreFetchedMessage($task);
                    }
                }
            } else {
                $this->logDebug('No messages in queue.', $logContext);
            }
        } catch (AwsException $e) {
            $this->logError('Popping tasks failed with MSG: '. $e->getAwsErrorMessage(), $logContext);
        }
    }
protected function doPop ( ) { // ensures that the SQS Queue exist if ( ! $ this -> queueExists ( ) ) { $ this -> createQueue ( ) ; } $ logContext = [ 'QueueUrl' => $ this -> queueUrl ] ; try { $ result = $ this -> getClient ( ) -> receiveMessage ( [ 'AttributeNames' => [ ] , //nothing 'MaxNumberOfMessages' => $ this -> getNumberOfTasksToReceive ( ) , 'MessageAttributeNames' => [ ] , //nothing 'QueueUrl' => $ this -> queueUrl , 'WaitTimeSeconds' => 20 //retrieving messages with Long Polling ] ) ; if ( count ( $ result -> get ( 'Messages' ) ) > 0 ) { $ this -> logDebug ( 'Received ' . count ( $ result -> get ( 'Messages' ) ) . ' messages.' , $ logContext ) ; foreach ( $ result -> get ( 'Messages' ) as $ message ) { $ task = $ this -> unserializeTask ( $ message [ 'Body' ] , $ message [ 'ReceiptHandle' ] , [ 'SqsMessageId' => $ message [ 'MessageId' ] ] ) ; if ( $ task ) { $ task -> setMetadata ( 'SqsMessageId' , $ message [ 'MessageId' ] ) ; $ task -> setMetadata ( 'ReceiptHandle' , $ message [ 'ReceiptHandle' ] ) ; $ this -> pushPreFetchedMessage ( $ task ) ; } } } else { $ this -> logDebug ( 'No messages in queue.' , $ logContext ) ; } } catch ( AwsException $ e ) { $ this -> logError ( 'Popping tasks failed with MSG: ' . $ e -> getAwsErrorMessage ( ) , $ logContext ) ; } }
Does the SQS specific pop mechanism.

@see http://docs.aws.amazon.com/aws-sdk-php/v3/api/api-sqs-2012-11-05.html#shape-message
Does the SQS specific pop mechanism .