Cloud/QueueService/Adapter/ZendQueue.php
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Cloud
- Subpackage
- QueueService
\Zend_Cloud_QueueService_Adapter_ZendQueue
WindowsAzure adapter for simple queue service.
Provides functionality around setting message and message set classes.
- Parent(s)
- \Zend_Cloud_QueueService_Adapter_AbstractAdapter
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants

MESSAGE_CLASS
= 'message_class'

MESSAGESET_CLASS
= 'messageset_class'

HTTP_ADAPTER
= 'http_adapter'
Ctor HTTP adapter option
Inherited from: \Zend_Cloud_QueueService_Adapter::HTTP_ADAPTER\Zend_Cloud_QueueService_Adapter_AbstractAdapter::HTTP_ADAPTER- Inherited_from
- \Zend_Cloud_QueueService_Adapter::HTTP_ADAPTER
- Inherited_from
- \Zend_Cloud_QueueService_Adapter_AbstractAdapter::HTTP_ADAPTER

VISIBILITY_TIMEOUT
= 'visibility_timeout'
Message visibility timeout option
Inherited from: \Zend_Cloud_QueueService_Adapter::VISIBILITY_TIMEOUT\Zend_Cloud_QueueService_Adapter_AbstractAdapter::VISIBILITY_TIMEOUT- Inherited_from
- \Zend_Cloud_QueueService_Adapter::VISIBILITY_TIMEOUT
- Inherited_from
- \Zend_Cloud_QueueService_Adapter_AbstractAdapter::VISIBILITY_TIMEOUT

DEFAULT_TIMEOUT
= 30
Default visibility timeout
Inherited from: \Zend_Cloud_QueueService_Adapter::DEFAULT_TIMEOUT\Zend_Cloud_QueueService_Adapter_AbstractAdapter::DEFAULT_TIMEOUT- Inherited_from
- \Zend_Cloud_QueueService_Adapter::DEFAULT_TIMEOUT
- Inherited_from
- \Zend_Cloud_QueueService_Adapter_AbstractAdapter::DEFAULT_TIMEOUT
Properties


string $_messageClass = 'Zend_Cloud_QueueService_Message'
'Zend_Cloud_QueueService_Message'
Details- Type
- string
- Inherited_from
- \Zend_Cloud_QueueService_Adapter_AbstractAdapter::$$_messageClass


string $_messageSetClass = 'Zend_Cloud_QueueService_MessageSet'
'Zend_Cloud_QueueService_MessageSet'
Details- Type
- string
- Inherited_from
- \Zend_Cloud_QueueService_Adapter_AbstractAdapter::$$_messageSetClass
Methods


__construct(array | \Zend_Config $options = array()) : void
Constructor
Name | Type | Description |
---|---|---|
$options | array | \Zend_Config |


_makeMessages(array $messages) : \Zend_Cloud_QueueService_Message[]
Create Zend_Cloud_QueueService_Message array for Azure messages.
Name | Type | Description |
---|---|---|
$messages | array |
Type | Description |
---|---|
\Zend_Cloud_QueueService_Message[] |


createQueue(string $name, array $options = null) : string
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 | Type | Description |
---|---|---|
$name | string | |
$options | array |
Type | Description |
---|---|
string | Queue ID (typically URL) |


deleteMessage(string $queueId, \Zend_Cloud_QueueService_Message $message, array $options = null) : void
Delete the specified message from the specified queue.
Name | Type | Description |
---|---|---|
$queueId | string | |
$message | \Zend_Cloud_QueueService_Message | Message ID or message |
$options | array |


deleteQueue(string $queueId, array $options = null) : boolean
Delete a queue.
All messages in the queue will also be deleted.
Name | Type | Description |
---|---|---|
$queueId | string | |
$options | array |
Type | Description |
---|---|
boolean | true if successful, false otherwise |


fetchQueueMetadata(string $queueId, array $options = null) : array
Get a key/value array of metadata for the given queue.
Name | Type | Description |
---|---|---|
$queueId | string | |
$options | array |
Type | Description |
---|---|
array |


getMessageClass() : string
Get class to use for message objects
Inherited from: \Zend_Cloud_QueueService_Adapter_AbstractAdapter::getMessageClass()Type | Description |
---|---|
string |


getMessageSetClass() : string
Get class to use for message collection objects
Inherited from: \Zend_Cloud_QueueService_Adapter_AbstractAdapter::getMessageSetClass()Type | Description |
---|---|
string |


listQueues(array $options = null) : array
List all queues.
Name | Type | Description |
---|---|---|
$options | array |
Type | Description |
---|---|
array | Queue IDs |


peekMessages(string $queueId, int $num = 1, array $options = null) : \Zend_Cloud_QueueService_Message[]
Peek at the messages from the specified queue without removing them.
Name | Type | Description |
---|---|---|
$queueId | string | |
$num | int | How many messages |
$options | array |
Type | Description |
---|---|
\Zend_Cloud_QueueService_Message[] |


receiveMessages(string $queueId, int $max = 1, array $options = null) : array
Recieve at most $max messages from the specified queue and return the message IDs for messages recieved.
Name | Type | Description |
---|---|---|
$queueId | string | |
$max | int | |
$options | array |
Type | Description |
---|---|
array |


sendMessage(string $queueId, string $message, array $options = null) : string
Send a message to the specified queue.
Name | Type | Description |
---|---|---|
$queueId | string | |
$message | string | |
$options | array |
Type | Description |
---|---|
string | Message ID |


setMessageClass(string $class) : \Zend_Cloud_QueueService_Adapter_AbstractAdapter
Set class to use for message objects
Inherited from: \Zend_Cloud_QueueService_Adapter_AbstractAdapter::setMessageClass()Name | Type | Description |
---|---|---|
$class | string |
Type | Description |
---|---|
\Zend_Cloud_QueueService_Adapter_AbstractAdapter |


setMessageSetClass(string $class) : \Zend_Cloud_QueueService_Adapter_AbstractAdapter
Set class to use for message collection objects
Inherited from: \Zend_Cloud_QueueService_Adapter_AbstractAdapter::setMessageSetClass()Name | Type | Description |
---|---|---|
$class | string |
Type | Description |
---|---|
\Zend_Cloud_QueueService_Adapter_AbstractAdapter |


storeQueueMetadata(string $queueId, array $metadata, array $options = null) : void
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.
Name | Type | Description |
---|---|---|
$queueId | string | |
$metadata | array | |
$options | array |