Common interface for queue services in the cloud. This interface supports most queue services and provides some flexibility for vendor-specific features and requirements via an optional $options array in each method signature. Classes implementing this interface should implement URI construction for queues from the parameters given in each method and the account data passed in to the constructor. Classes implementing this interface are also responsible for security; access control isn't currently supported in this interface, although we are considering access control support in future versions of the interface.

category Zend
package Zend_Cloud
subpackage QueueService
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Create a queue. Returns the ID of the created queue (typically the URL).

createQueue(string $name, array $options = null) : string

It may take some time to create the queue. Check your vendor's documentation for details.

Name constraints: Maximum 80 characters Only alphanumeric characters, hyphens (-), and underscores (_)

Parameters

$name

string

$options

array

Returns

stringQueue ID (typically URL)

Delete the specified message from the specified queue.

deleteMessage(string $queueId, \Zend_Cloud_QueueService_Message $message, array $options = null) : void

Parameters

$queueId

string

$message

\Zend_Cloud_QueueService_Message

Message to delete

$options

array

Delete a queue. All messages in the queue will also be deleted.

deleteQueue(string $queueId, array $options = null) : boolean

Parameters

$queueId

string

$options

array

Returns

booleantrue if successful, false otherwise

Get the concrete adapter.

getClient() 

List all queues.

listQueues(array $options = null) : array

Parameters

$options

array

Returns

arrayQueue IDs

Peek at the messages from the specified queue without removing them.

peekMessages(string $queueId, integer $num = 1, array $options = null) : \array[Zend_Cloud_QueueService_Message]

Parameters

$queueId

string

$num

integer

How many messages

$options

array

Returns

\array[Zend_Cloud_QueueService_Message]

Recieve at most $max messages from the specified queue and return the message IDs for messages recieved.

receiveMessages(string $queueId, integer $max = 1, array $options = null) : \array[Zend_Cloud_QueueService_Message]

Parameters

$queueId

string

$max

integer

$options

array

Returns

\array[Zend_Cloud_QueueService_Message]Array of messages

Send a message to the specified queue.

sendMessage(string $queueId, string $message, array $options = null) : string

Parameters

$queueId

string

$message

string

$options

array

Returns

stringMessage ID

 Constants

 

Default visibility timeout

DEFAULT_TIMEOUT = 30 
 

Ctor HTTP adapter option

HTTP_ADAPTER = 'http_adapter' 
 

Message visibility timeout option

VISIBILITY_TIMEOUT = 'visibility_timeout'