Queue.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 license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Queue
- Version
- $Id$
\Zend_Queue
Package: Zend_Queue



Returns




Returns
Throws















Class for connecting to queues performing common operations.
- Implements
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties

string $_messageClass = 'Zend_Queue_Message'Zend_Queue_Message class
Default value
'Zend_Queue_Message'Details- Type
- string

string $_messageSetClass = 'Zend_Queue_Message_Iterator'Zend_Queue_Message_Iterator class
Default value
'Zend_Queue_Message_Iterator'Details- Type
- string
Methods

__construct( $spec, \Zend_Config | array $options = array()) : voidConstructor
Can be called as
$queue = new Zend_Queue($config);
- or -
$queue = new Zend_Queue('array', $config);
- or -
$queue = new Zend_Queue(null, $config); // Zend_Queue->createQueue();
Parameters| Name | Type | Description |
|---|---|---|
| $spec | ||
| $options | \Zend_Config | array | Zend_Config or a configuration array |

_setName(string $name) : \Zend_Queue | falseSet the name of the queue
This is AN UNSUPPORTED FUNCTION
Parameters| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| \Zend_Queue | false | Provides a fluent interface |

count() : integerReturns the approximate number of messages in the queue
Returns
| Type | Description |
|---|---|
| integer |

createQueue(string $name, integer $timeout = null) : \Zend_Queue | falseCreate a new queue
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $name | string | queue name |
| $timeout | integer | default visibility timeout |
| Type | Description |
|---|---|
| \Zend_Queue | false |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

debugInfo() : arrayreturns a listing of Zend_Queue details.
useful for debugging
Returns| Type | Description |
|---|---|
| array |

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

deleteQueue() : booleanDelete the queue this object is working on.
This queue is disabled, regardless of the outcome of the deletion
of the queue, because the programmers intent is to disable this queue.
Returns| Type | Description |
|---|---|
| boolean |

getAdapter() : \Zend_Queue_Adapter_AdapterInterfaceGet the adapter for this queue
Returns
| Type | Description |
|---|---|
| \Zend_Queue_Adapter_AdapterInterface |

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

getName() : stringGet the name of the queue
Note: _setName() used to exist, but it caused confusion with createQueue
Will evaluate later to see if we should add it back in.
Returns| Type | Description |
|---|---|
| string |

getOption(string $name) : null | mixedRetrieve a single option
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| null | mixed | Returns null if option does not exist; option value otherwise |

getQueues() : arrayGet an array of all available queues
Returns
Throws
| Type | Description |
|---|---|
| array |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

hasOption(string $name) : boolDetermine if a requested option has been defined
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| bool |

isSupported(string $name) : booleanIndicates if a function is supported or not.
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| boolean |

receive(integer $maxMessages = null, integer $timeout = null) : \Zend_Queue_Message_IteratorReturn the first element in the queue
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $maxMessages | integer | |
| $timeout | integer |
| Type | Description |
|---|---|
| \Zend_Queue_Message_Iterator |

send(mixed $message) : \Zend_Queue_MessageSend a message to the queue
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $message | mixed | message |
| Type | Description |
|---|---|
| \Zend_Queue_Message |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

setAdapter(string | \Zend_Queue_Adapter_AdapterInterface $adapter) : \Zend_QueueSet the adapter for this queue
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $adapter | string | \Zend_Queue_Adapter_AdapterInterface |
| Type | Description |
|---|---|
| \Zend_Queue | Provides a fluent interface |

setMessageClass(string $className) : \Zend_QueueParameters
Returns
| Name | Type | Description |
|---|---|---|
| $className | string |
| Type | Description |
|---|---|
| \Zend_Queue | Provides a fluent interface |

setMessageSetClass(string $className) : \Zend_QueueParameters
Returns
| Name | Type | Description |
|---|---|---|
| $className | string |
| Type | Description |
|---|---|
| \Zend_Queue | Provides a fluent interface |

setOption(string $name, mixed $value) : \Zend_QueueSet an individual configuration option
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $value | mixed |
| Type | Description |
|---|---|
| \Zend_Queue |

setOptions(array $options) : \Zend_QueueSet queue options
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $options | array |
| Type | Description |
|---|---|
| \Zend_Queue |