Zend Framework  1.12
Public Member Functions | Public Attributes | List of all members
Zend_Cloud_QueueService_Adapter Interface Reference

Public Member Functions

 createQueue ($name, $options=null)
 Create a queue.
 
 deleteQueue ($queueId, $options=null)
 Delete a queue.
 
 listQueues ($options=null)
 List all queues.
 
 fetchQueueMetadata ($queueId, $options=null)
 Get a key/value array of metadata for the given queue.
 
 storeQueueMetadata ($queueId, $metadata, $options=null)
 Store a key/value array of metadata for the specified queue.
 
 sendMessage ($queueId, $message, $options=null)
 Send a message to the specified queue.
 
 receiveMessages ($queueId, $max=1, $options=null)
 Recieve at most $max messages from the specified queue and return the message IDs for messages recieved.
 
 peekMessages ($queueId, $num=1, $options=null)
 Peek at the messages from the specified queue without removing them.
 
 deleteMessage ($queueId, $message, $options=null)
 Delete the specified message from the specified queue.
 
 getClient ()
 Get the concrete adapter.
 

Public Attributes

const HTTP_ADAPTER = 'http_adapter'
 Ctor HTTP adapter option.
 
const VISIBILITY_TIMEOUT = 'visibility_timeout'
 Message visibility timeout option.
 
const DEFAULT_TIMEOUT = 30
 Default visibility timeout.
 

Member Function Documentation

createQueue (   $name,
  $options = null 
)

Create a queue.

Returns the ID of the created queue (typically the URL). 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
string$name
array$options
Returns
string Queue ID (typically URL)

Implemented in Zend_Cloud_QueueService_Adapter_WindowsAzure, Zend_Cloud_QueueService_Adapter_Sqs, and Zend_Cloud_QueueService_Adapter_ZendQueue.

deleteMessage (   $queueId,
  $message,
  $options = null 
)

Delete the specified message from the specified queue.

Parameters
string$queueId
Zend_Cloud_QueueService_Message$messageMessage to delete
array$options
Returns
void

Implemented in Zend_Cloud_QueueService_Adapter_WindowsAzure, Zend_Cloud_QueueService_Adapter_ZendQueue, and Zend_Cloud_QueueService_Adapter_Sqs.

deleteQueue (   $queueId,
  $options = null 
)

Delete a queue.

All messages in the queue will also be deleted.

Parameters
string$queueId
array$options
Returns
boolean true if successful, false otherwise

Implemented in Zend_Cloud_QueueService_Adapter_WindowsAzure, Zend_Cloud_QueueService_Adapter_ZendQueue, and Zend_Cloud_QueueService_Adapter_Sqs.

fetchQueueMetadata (   $queueId,
  $options = null 
)

Get a key/value array of metadata for the given queue.

Parameters
string$queueId
array$options
Returns
array

Implemented in Zend_Cloud_QueueService_Adapter_WindowsAzure, Zend_Cloud_QueueService_Adapter_ZendQueue, and Zend_Cloud_QueueService_Adapter_Sqs.

getClient ( )
listQueues (   $options = null)

List all queues.

Parameters
array$options
Returns
array Queue IDs

Implemented in Zend_Cloud_QueueService_Adapter_WindowsAzure, Zend_Cloud_QueueService_Adapter_ZendQueue, and Zend_Cloud_QueueService_Adapter_Sqs.

peekMessages (   $queueId,
  $num = 1,
  $options = null 
)

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

Parameters
string$queueId
int$numHow many messages
array$options
Returns
array[Zend_Cloud_QueueService_Message]

Implemented in Zend_Cloud_QueueService_Adapter_WindowsAzure, Zend_Cloud_QueueService_Adapter_ZendQueue, and Zend_Cloud_QueueService_Adapter_Sqs.

receiveMessages (   $queueId,
  $max = 1,
  $options = null 
)

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

Parameters
string$queueId
int$max
array$options
Returns
array[Zend_Cloud_QueueService_Message] Array of messages

Implemented in Zend_Cloud_QueueService_Adapter_WindowsAzure, Zend_Cloud_QueueService_Adapter_ZendQueue, and Zend_Cloud_QueueService_Adapter_Sqs.

sendMessage (   $queueId,
  $message,
  $options = null 
)

Send a message to the specified queue.

Parameters
string$queueId
string$message
array$options
Returns
string Message ID

Implemented in Zend_Cloud_QueueService_Adapter_WindowsAzure, Zend_Cloud_QueueService_Adapter_ZendQueue, and Zend_Cloud_QueueService_Adapter_Sqs.

storeQueueMetadata (   $queueId,
  $metadata,
  $options = null 
)

Store a key/value array of metadata for the specified queue.

WARNING: This operation overwrites any metadata that is located at $destinationPath. Some adapters may not support this method.

Parameters
string$queueId
array$metadata
array$options
Returns
void

Implemented in Zend_Cloud_QueueService_Adapter_WindowsAzure, Zend_Cloud_QueueService_Adapter_ZendQueue, and Zend_Cloud_QueueService_Adapter_Sqs.

Member Data Documentation

const DEFAULT_TIMEOUT = 30

Default visibility timeout.

const HTTP_ADAPTER = 'http_adapter'

Ctor HTTP adapter option.

const VISIBILITY_TIMEOUT = 'visibility_timeout'

Message visibility timeout option.