Queue/Adapter/PlatformJobQueue.php
Zend Framework
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_Queue
- Subpackage
- Adapter
- Version
- $Id: PlatformJobQueue.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Queue_Adapter_PlatformJobQueue
Zend Platform JobQueue adapter
- Parent(s)
- \Zend_Queue_Adapter_AdapterAbstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
CREATE_TIMEOUT_DEFAULT
= 30Default timeout for createQueue() function
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::CREATE_TIMEOUT_DEFAULT- Inherited_from
- \Zend_Queue_Adapter_AdapterAbstract::CREATE_TIMEOUT_DEFAULT
RECEIVE_TIMEOUT_DEFAULT
= 30Default timeout for recieve() function
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::RECEIVE_TIMEOUT_DEFAULT- Inherited_from
- \Zend_Queue_Adapter_AdapterAbstract::RECEIVE_TIMEOUT_DEFAULT
Properties

array $_options = array()
array()Details- Type
- array
- Inherited_from
- \Zend_Queue_Adapter_AdapterAbstract::$$_options

\Zend_Queue_Adapter_Abstract $_queue = nullContains the Zend_Queue that this object
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::$$_queuenullDetails- Type
- \Zend_Queue_Adapter_Abstract
- Inherited_from
- \Zend_Queue_Adapter_AdapterAbstract::$$_queue

array $_queues = array()Internal array of queues to save on lookups
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::$$_queuesarray()Details- Type
- array
- Inherited_from
- \Zend_Queue_Adapter_AdapterAbstract::$$_queues
Methods

__construct(array | \Zend_Config $options, \Zend_Queue | null $queue = null) : voidConstructor
$options is an array of key/value pairs or an instance of Zend_Config containing configuration options. These options are common to most adapters:
See the Zend_Queue Adapter Notes documentation for example configurations.
Some options are used on a case-by-case basis by adapters:
access_key => (string) Amazon AWS Access Key secret_key => (string) Amazon AWS Secret Key dbname => (string) The name of the database to user username => (string) Connect to the database as this username. password => (string) Password associated with the username. host => (string) What host to connect to, defaults to localhost port => (string) The port of the database
| Name | Type | Description |
|---|---|---|
| $options | array | \Zend_Config | |
| $queue | \Zend_Queue | null |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

count(\Zend_Queue | null $queue = null) : integerReturn the approximate number of messages in the queue
| Name | Type | Description |
|---|---|---|
| $queue | \Zend_Queue | null |
| Type | Description |
|---|---|
| integer |

create(string $name, integer $timeout = null) : voidCreate a new queue
Visibility timeout is how long a message is left in the queue "invisible" to other readers. If the message is acknowleged (deleted) before the timeout, then the message is deleted. However, if the timeout expires then the message will be made available to other queue readers.
| Name | Type | Description |
|---|---|---|
| $name | string | queue name |
| $timeout | integer | default visibility timeout |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

delete(string $name) : voidDelete a queue and all of its messages
Return false if the queue is not found, true if the queue exists.
| Name | Type | Description |
|---|---|---|
| $name | string | queue name |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

deleteMessage(\Zend_Queue_Message $message) : booleanDelete a message from the queue
Returns true if the message is deleted, false if the deletion is unsuccessful.
| Name | Type | Description |
|---|---|---|
| $message | \Zend_Queue_Message |
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

getCapabilities() : arrayReturn a list of queue capabilities functions
$array['function name'] = true or false true is supported, false is not supported.
| Type | Description |
|---|---|
| array |

getOptions() : arrayReturns the configuration options in this adapter.
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::getOptions()| Type | Description |
|---|---|
| array |

getQueue() : \Zend_Queue | nullget the Zend_Queue class that is attached to this object
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::getQueue()| Type | Description |
|---|---|
| \Zend_Queue | null |

getQueues() : voidGet an array of all available queues
Not all adapters support getQueues(); use isSupported('getQueues') to determine if the adapter supports this feature.
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

isExists(string $name) : booleanDoes a queue already exist?
Use isSupported('isExists') to determine if an adapter can test for queue existance.
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception | (not supported) |

isSupported(string $name) : booleanIndicates if a function is supported or not.
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::isSupported()| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| boolean |

receive(integer $maxMessages = null, integer $timeout = null, \Zend_Queue $queue = null) : \ArrayIteratorGet messages in the queue
| Name | Type | Description |
|---|---|---|
| $maxMessages | integer | Maximum number of messages to return |
| $timeout | integer | Ignored |
| $queue | \Zend_Queue | Not supported |
| Type | Description |
|---|---|
| \ArrayIterator |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

send(array $message, \Zend_Queue $queue = null) : \Zend_Queue_MessageSend a message to the queue
| Name | Type | Description |
|---|---|---|
| $message | array | | ZendAPI_job $message Message to send to the active queue |
| $queue | \Zend_Queue | Not supported |
| Type | Description |
|---|---|
| \Zend_Queue_Message |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

setQueue(\Zend_Queue $queue) : \Zend_Queue_Adapter_AdapterInterfaceset the Zend_Queue class for this object
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::setQueue()| Name | Type | Description |
|---|---|---|
| $queue | \Zend_Queue |
| Type | Description |
|---|---|
| \Zend_Queue_Adapter_AdapterInterface |