API Documentation

Queue/Adapter/Memcacheq.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Queue
subpackage
Adapter
version
$Id: Memcacheq.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Queue_Adapter_Memcacheq

Description

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.

Zend_Queue_Adapter_Memcacheq

Extends from
Zend_Queue_Adapter_AdapterAbstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Queue
subpackage
Adapter
Constants
DEFAULT_HOST
DEFAULT_PORT
EOL
Properties
$_cache
$_host
$_port
$_socket
Methods
__construct
__destruct
isExists
create
delete
getQueues
count
send
receive
deleteMessage
getCapabilities
_sendCommand

Description

Class for using connecting to a Zend_Cache-based queuing system

Constants

DEFAULT_HOST

 DEFAULT_HOST = '127.0.0.1'

Details

value
127.0.0.1

DEFAULT_PORT

 DEFAULT_PORT = '22201'

Details

value
22201

EOL

 EOL = '\r\n'

Details

value
\r\n

Properties

$_cache

Memcache $_cache = 'null'

Details

$_cache
Memcache
visibility
protected
default
null
final
false
static
false

$_host

string $_host = 'null'

Details

$_host
string
visibility
protected
default
null
final
false
static
false

$_port

integer $_port = 'null'

Details

$_port
integer
visibility
protected
default
null
final
false
static
false

$_socket

resource $_socket = 'null'

Details

$_socket
resource
visibility
protected
default
null
final
false
static
false

Methods

__construct

__construct( array|Zend_Config $options, null|Zend_Queue $queue = null ) : void

Constructor

Arguments
$options
arrayZend_Config
$queue
nullZend_Queue
Details
visibility
public
final
false
static
false

__destruct

__destruct( ) : void

Destructor

Details
visibility
public
final
false
static
false

_sendCommand

_sendCommand( string $command, array $terminator, boolean $include_term = false ) : array

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.

Arguments
$command
string
- command to send to memcacheQ
$terminator
array
- strings to indicate end of memcacheQ response
$include_term
boolean
- include terminator in response
Output
array
Details
visibility
protected
final
false
static
false
throws
if connection cannot be opened

count

count( Zend_Queue $queue = null ) : integer

Return the approximate number of messages in the queue

Arguments
$queue
Zend_Queue
Output
integer
Details
visibility
public
final
false
static
false
throws
(not supported)

create

create( string $name, integer $timeout = null ) : boolean

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.

Arguments
$name
string
queue name
$timeout
integer
default visibility timeout
Output
boolean
Details
visibility
public
final
false
static
false
throws

delete

delete( string $name ) : boolean

Delete a queue and all of it's messages

Returns false if the queue is not found, true if the queue exists

Arguments
$name
string
queue name
Output
boolean
Details
visibility
public
final
false
static
false
throws

deleteMessage

deleteMessage( Zend_Queue_Message $message ) : boolean

Delete a message from the queue

Returns true if the message is deleted, false if the deletion is unsuccessful.

Arguments
$message
Zend_Queue_Message
Output
boolean
Details
visibility
public
final
false
static
false
throws
(unsupported)

getCapabilities

getCapabilities( ) : array

Return a list of queue capabilities functions

$array['function name'] = true or false true is supported, false is not supported.

Output
array
Details
visibility
public
final
false
static
false

getQueues

getQueues( ) : array

Get an array of all available queues

Not all adapters support getQueues(), use isSupported('getQueues') to determine if the adapter supports this feature.

Output
array
Details
visibility
public
final
false
static
false
throws

isExists

isExists( string $name ) : boolean

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.

Arguments
$name
string
Output
boolean
Details
visibility
public
final
false
static
false
throws

receive

receive( integer $maxMessages = null, integer $timeout = null, Zend_Queue $queue = null ) : Zend_Queue_Message_Iterator

Get messages in the queue

Arguments
$maxMessages
integer
Maximum number of messages to return
$timeout
integer
Visibility timeout for these messages
$queue
Zend_Queue
Details
visibility
public
final
false
static
false
throws

send

send( string $message, Zend_Queue $queue = null ) : Zend_Queue_Message

Send a message to the queue

Arguments
$message
string
Message to send to the active queue
$queue
Zend_Queue
Details
visibility
public
final
false
static
false
throws
Documentation was generated by DocBlox.