Zend Framework
1.12
|
Public Member Functions | |
__construct ($options, Zend_Queue $queue=null) | |
Constructor. | |
__destruct () | |
Destructor. | |
isExists ($name) | |
Does a queue already exist? | |
create ($name, $timeout=null) | |
Create a new queue. | |
delete ($name) | |
Delete a queue and all of it's messages. | |
getQueues () | |
Get an array of all available queues. | |
count (Zend_Queue $queue=null) | |
Return the approximate number of messages in the queue. | |
send ($message, Zend_Queue $queue=null) | |
Send a message to the queue. | |
receive ($maxMessages=null, $timeout=null, Zend_Queue $queue=null) | |
Get messages in the queue. | |
deleteMessage (Zend_Queue_Message $message) | |
Delete a message from the queue. | |
getCapabilities () | |
Return a list of queue capabilities functions. | |
![]() | |
__construct ($options, Zend_Queue $queue=null) | |
Constructor. | |
getQueue () | |
get the Zend_Queue class that is attached to this object | |
setQueue (Zend_Queue $queue) | |
set the Zend_Queue class for this object | |
getOptions () | |
Returns the configuration options in this adapter. | |
isSupported ($name) | |
Indicates if a function is supported or not. | |
Public Attributes | |
const | DEFAULT_HOST = '127.0.0.1' |
const | DEFAULT_PORT = 22201 |
const | EOL = "\r\n" |
![]() | |
const | CREATE_TIMEOUT_DEFAULT = 30 |
Default timeout for createQueue() function. | |
const | RECEIVE_TIMEOUT_DEFAULT = 30 |
Default timeout for recieve() function. | |
Protected Member Functions | |
_sendCommand ($command, array $terminator, $include_term=false) | |
sends a command to MemcacheQ | |
Protected Attributes | |
$_cache = null | |
$_host = null | |
$_port = null | |
$_socket = null | |
![]() | |
$_options = array() | |
$_queues = array() | |
$_queue = null | |
__construct | ( | $options, | |
Zend_Queue | $queue = null |
||
) |
Constructor.
array | Zend_Config | $options | |
null | Zend_Queue | $queue |
Implements Zend_Queue_Adapter_AdapterInterface.
__destruct | ( | ) |
Destructor.
|
protected |
sends 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.
string | $command | - command to send to memcacheQ |
array | $terminator | - strings to indicate end of memcacheQ response |
boolean | $include_term | - include terminator in response |
Zend_Queue_Exception | if connection cannot be opened |
count | ( | Zend_Queue | $queue = null | ) |
Return the approximate number of messages in the queue.
Zend_Queue | $queue |
Zend_Queue_Exception | (not supported) |
Implements Zend_Queue_Adapter_AdapterInterface.
create | ( | $name, | |
$timeout = null |
|||
) |
Create 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.
string | $name | queue name |
integer | $timeout | default visibility timeout |
Zend_Queue_Exception |
Implements Zend_Queue_Adapter_AdapterInterface.
delete | ( | $name | ) |
Delete a queue and all of it's messages.
Returns false if the queue is not found, true if the queue exists
string | $name | queue name |
Zend_Queue_Exception |
Implements Zend_Queue_Adapter_AdapterInterface.
deleteMessage | ( | Zend_Queue_Message | $message | ) |
Delete a message from the queue.
Returns true if the message is deleted, false if the deletion is unsuccessful.
Zend_Queue_Message | $message |
Zend_Queue_Exception | (unsupported) |
Implements Zend_Queue_Adapter_AdapterInterface.
getCapabilities | ( | ) |
Return a list of queue capabilities functions.
$array['function name'] = true or false true is supported, false is not supported.
string | $name |
Implements Zend_Queue_Adapter_AdapterInterface.
getQueues | ( | ) |
Get an array of all available queues.
Not all adapters support getQueues(), use isSupported('getQueues') to determine if the adapter supports this feature.
Zend_Queue_Exception |
Implements Zend_Queue_Adapter_AdapterInterface.
isExists | ( | $name | ) |
Does 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.
string | $name |
Zend_Queue_Exception |
Implements Zend_Queue_Adapter_AdapterInterface.
receive | ( | $maxMessages = null , |
|
$timeout = null , |
|||
Zend_Queue | $queue = null |
||
) |
Get messages in the queue.
integer | $maxMessages | Maximum number of messages to return |
integer | $timeout | Visibility timeout for these messages |
Zend_Queue | $queue |
Zend_Queue_Exception |
Implements Zend_Queue_Adapter_AdapterInterface.
send | ( | $message, | |
Zend_Queue | $queue = null |
||
) |
Send a message to the queue.
string | $message | Message to send to the active queue |
Zend_Queue | $queue |
Zend_Queue_Exception |
Implements Zend_Queue_Adapter_AdapterInterface.
|
protected |
|
protected |
|
protected |
|
protected |
const DEFAULT_HOST = '127.0.0.1' |
const DEFAULT_PORT = 22201 |
const EOL = "\r\n" |