Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Zend_Queue Class Reference

Public Member Functions

 __construct ($spec, $options=array())
 Constructor.
 
 setOptions (array $options)
 Set queue options.
 
 setOption ($name, $value)
 Set an individual configuration option.
 
 getOptions ()
 Returns the configuration options for the queue.
 
 hasOption ($name)
 Determine if a requested option has been defined.
 
 getOption ($name)
 Retrieve a single option.
 
 setAdapter ($adapter)
 Set the adapter for this queue.
 
 getAdapter ()
 Get the adapter for this queue.
 
 setMessageClass ($className)
 
 getMessageClass ()
 
 setMessageSetClass ($className)
 
 getMessageSetClass ()
 
 getName ()
 Get the name of the queue.
 
 createQueue ($name, $timeout=null)
 Create a new queue.
 
 deleteQueue ()
 Delete the queue this object is working on.
 
 deleteMessage (Zend_Queue_Message $message)
 Delete a message from the queue.
 
 send ($message)
 Send a message to the queue.
 
 count ()
 Returns the approximate number of messages in the queue.
 
 receive ($maxMessages=null, $timeout=null)
 Return the first element in the queue.
 
 getCapabilities ()
 Return a list of queue capabilities functions.
 
 isSupported ($name)
 Indicates if a function is supported or not.
 
 getQueues ()
 Get an array of all available queues.
 
 debugInfo ()
 returns a listing of Zend_Queue details.
 

Public Attributes

const TIMEOUT = 'timeout'
 Use the TIMEOUT constant in the config of a Zend_Queue.
 
const VISIBILITY_TIMEOUT = 30
 Default visibility passed to count.
 
const NAME = 'name'
 Use the NAME constant in the config of Zend_Queue.
 

Protected Member Functions

 _setName ($name)
 Set the name of the queue.
 

Protected Attributes

 $_adapter = null
 
 $_options = array()
 
 $_messageClass = 'Zend_Queue_Message'
 
 $_messageSetClass = 'Zend_Queue_Message_Iterator'
 
 $_logger = null
 

Constructor & Destructor Documentation

__construct (   $spec,
  $options = array() 
)

Constructor.

Can be called as $queue = new Zend_Queue($config);

Parameters
string|Zend_Queue_Adapter|array|Zend_Config|nullString or adapter instance, or options array or Zend_Config instance
Zend_Config | array$optionsZend_Config or a configuration array
Returns
void

Member Function Documentation

_setName (   $name)
protected

Set the name of the queue.

This is AN UNSUPPORTED FUNCTION

Parameters
string$name
Returns
Zend_Queue|false Provides a fluent interface
See Also
Zend_Queue_Exception
count ( )

Returns the approximate number of messages in the queue.

Returns
integer
createQueue (   $name,
  $timeout = null 
)

Create a new queue.

Parameters
string$namequeue name
integer$timeoutdefault visibility timeout
Returns
Zend_Queue|false
Exceptions
Zend_Queue_Exception
debugInfo ( )

returns a listing of Zend_Queue details.

useful for debugging

Returns
array
deleteMessage ( Zend_Queue_Message  $message)

Delete 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
Zend_Queue_Message$message
Returns
boolean
Exceptions
Zend_Queue_Exception
deleteQueue ( )

Delete 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
boolean
See Also
Zend_Queue_Adapter_Null
getAdapter ( )

Get the adapter for this queue.

Returns
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.

Parameters
string$name
Returns
array
getMessageClass ( )
Returns
string
getMessageSetClass ( )
Returns
string
getName ( )

Get 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
string
getOption (   $name)

Retrieve a single option.

Parameters
string$name
Returns
null|mixed Returns null if option does not exist; option value otherwise
getOptions ( )

Returns the configuration options for the queue.

Returns
array
getQueues ( )

Get an array of all available queues.

Returns
array
Exceptions
Zend_Queue_Exception
hasOption (   $name)

Determine if a requested option has been defined.

Parameters
string$name
Returns
bool
isSupported (   $name)

Indicates if a function is supported or not.

Parameters
string$name
Returns
boolean
receive (   $maxMessages = null,
  $timeout = null 
)

Return the first element in the queue.

Parameters
integer$maxMessages
integer$timeout
Returns
Zend_Queue_Message_Iterator
send (   $message)

Send a message to the queue.

Parameters
mixed$messagemessage
Returns
Zend_Queue_Message
Exceptions
Zend_Queue_Exception
setAdapter (   $adapter)

Set the adapter for this queue.

Parameters
string | Zend_Queue_Adapter_AdapterInterface$adapter
Returns
Zend_Queue Provides a fluent interface
setMessageClass (   $className)
Parameters
string$className
Returns
Zend_Queue Provides a fluent interface
setMessageSetClass (   $className)
Parameters
string$className
Returns
Zend_Queue Provides a fluent interface
setOption (   $name,
  $value 
)

Set an individual configuration option.

Parameters
string$name
mixed$value
Returns
Zend_Queue
setOptions ( array  $options)

Set queue options.

Parameters
array$options
Returns
Zend_Queue

Member Data Documentation

$_adapter = null
protected
$_logger = null
protected
$_messageClass = 'Zend_Queue_Message'
protected
$_messageSetClass = 'Zend_Queue_Message_Iterator'
protected
$_options = array()
protected
const NAME = 'name'

Use the NAME constant in the config of Zend_Queue.

const TIMEOUT = 'timeout'

Use the TIMEOUT constant in the config of a Zend_Queue.

const VISIBILITY_TIMEOUT = 30

Default visibility passed to count.