Queue/Adapter/Memcacheq.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
- Subpackage
- Adapter
- Version
- $Id$
\Zend_Queue_Adapter_Memcacheq
Package: Zend_Queue\Adapter

Returns
Throws


Returns
Throws

Returns
Throws

Returns
Throws


Throws

Returns
Throws


Class for using connecting to a Zend_Cache-based queuing system
- Parent(s)
- \Zend_Queue_Adapter_AdapterAbstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties
Methods

__construct(array | \Zend_Config $options, null | \Zend_Queue $queue = null) : voidConstructor
Parameters
| Name | Type | Description |
|---|---|---|
| $options | array | \Zend_Config | |
| $queue | null | \Zend_Queue |

_sendCommand(string $command, array $terminator, boolean $include_term = false) : arraysends a command to MemcacheQ
The memcache functions by php cannot handle all types of requests
supported by MemcacheQ
Non-standard requests are handled by this function.
Parameters| Name | Type | Description |
|---|---|---|
| $command | string |
|
| $terminator | array |
|
| $include_term | boolean |
|
| Type | Description |
|---|---|
| array |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception | if connection cannot be opened |

count(\Zend_Queue $queue = null) : integerReturn the approximate number of messages in the queue
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $queue | \Zend_Queue |
| Type | Description |
|---|---|
| integer |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception | (not supported) |

create(string $name, integer $timeout = null) : booleanCreate 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.
Parameters| Name | Type | Description |
|---|---|---|
| $name | string | queue name |
| $timeout | integer | default visibility timeout |
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

delete(string $name) : booleanDelete a queue and all of it's messages
Returns false if the queue is not found, true if the queue exists
Parameters| Name | Type | Description |
|---|---|---|
| $name | string | queue name |
| Type | Description |
|---|---|
| boolean |
| 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.
Parameters| Name | Type | Description |
|---|---|---|
| $message | \Zend_Queue_Message |
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception | (unsupported) |

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 |

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

isExists(string $name) : booleanDoes a queue already exist?
Throws an exception if the adapter cannot determine if a queue exists.
use isSupported('isExists') to determine if an adapter can test for
queue existance.
Parameters| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| boolean |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

receive(integer $maxMessages = null, integer $timeout = null, \Zend_Queue $queue = null) : \Zend_Queue_Message_IteratorGet messages in the queue
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $maxMessages | integer | Maximum number of messages to return |
| $timeout | integer | Visibility timeout for these messages |
| $queue | \Zend_Queue |
| Type | Description |
|---|---|
| \Zend_Queue_Message_Iterator |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |

send(string $message, \Zend_Queue $queue = null) : \Zend_Queue_MessageSend a message to the queue
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $message | string | Message to send to the active queue |
| $queue | \Zend_Queue |
| Type | Description |
|---|---|
| \Zend_Queue_Message |
| Exception | Description |
|---|---|
| \Zend_Queue_Exception |