public function receive_message($client, $timeout)
    {
        $decodedClient = is_object($client) ? $client : json_decode($client);

        $queue = $decodedClient->{'queues'}->{'output'};
        if ($this->debug)
            $this->log_out(
                "DEBUG", 
                "Polling from '$queue' ..."
            );
        
        // Poll from SQS to check for new message 
        $result = $this->sqs->receiveMessage(array(
                'QueueUrl'        => $queue,
                'WaitTimeSeconds' => $timeout,
            ));
            
        // Get the message if any and return it to the caller
        if (($messages = $result->get('Messages')) &&
            count($messages))
        {
            if ($this->debug)
                $this->log_out(
                    "DEBUG", 
                    "New messages recieved in queue: '$queue'"
                );
            
            return $messages[0];
        }
        
        return false;
    }
public function receive_message($client, $timeout)
    {
        $decodedClient = is_object($client) ? $client : json_decode($client);

        $queue = $decodedClient->{'queues'}->{'output'};
        if ($this->debug)
            $this->log_out(
                "DEBUG", 
                "Polling from '$queue' ..."
            );
        
        // Poll from SQS to check for new message 
        $result = $this->sqs->receiveMessage(array(
                'QueueUrl'        => $queue,
                'WaitTimeSeconds' => $timeout,
            ));
            
        // Get the message if any and return it to the caller
        if (($messages = $result->get('Messages')) &&
            count($messages))
        {
            if ($this->debug)
                $this->log_out(
                    "DEBUG", 
                    "New messages recieved in queue: '$queue'"
                );
            
            return $messages[0];
        }
        
        return false;
    }
public function receive_message ( $ client , $ timeout ) { $ decodedClient = is_object ( $ client ) ? $ client : json_decode ( $ client ) ; $ queue = $ decodedClient -> { 'queues' } -> { 'output' } ; if ( $ this -> debug ) $ this -> log_out ( "DEBUG" , "Polling from '$queue' ..." ) ; // Poll from SQS to check for new message  $ result = $ this -> sqs -> receiveMessage ( array ( 'QueueUrl' => $ queue , 'WaitTimeSeconds' => $ timeout , ) ) ; // Get the message if any and return it to the caller if ( ( $ messages = $ result -> get ( 'Messages' ) ) && count ( $ messages ) ) { if ( $ this -> debug ) $ this -> log_out ( "DEBUG" , "New messages recieved in queue: '$queue'" ) ; return $ messages [ 0 ] ; } return false ; }
Poll for incoming SQS messages using this method.

Call this method in a loop in your client application.
If a new message is polled, it is returned to the caller.

@param string|object $client JSON string or PHP Object created using json_decode. This contains your client SQS configuration which list your application `input` and `output` queues.
@param integer $timeout Timeout value for the polling. After $timeout, the poller will return.

@return object|false The SQS message or false if nothing. Can throw an Exception. Use try catch.
Poll for incoming SQS messages using this method .