Queue/Adapter/Null.php

Show: PublicProtectedPrivateinherited
Table of Contents
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Queue  
Subpackage
Adapter  
Version
$Id: Null.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Queue_Adapter_Null

Package: Zend\Queue\Adapter
Class testing.

No supported functions. Also used to disable a Zend_Queue.

Parent(s)
\Zend_Queue_Adapter_AdapterAbstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  CREATE_TIMEOUT_DEFAULT = 30
inherited
Default timeout for createQueue() function
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::CREATE_TIMEOUT_DEFAULT
>VConstant  RECEIVE_TIMEOUT_DEFAULT = 30
inherited
Default timeout for recieve() function
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::RECEIVE_TIMEOUT_DEFAULT

Properties

>VPropertyprotectedarray $_options = array()
inherited
User-provided options
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::$$_options
Default valuearray()Details
Type
array
Inherited_from
\Zend_Queue_Adapter_AdapterAbstract::$$_options  
>VPropertyprotected\Zend_Queue_Adapter_Abstract $_queue = null
inherited
Contains the Zend_Queue that this object
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::$$_queue
Default valuenullDetails
Type
\Zend_Queue_Adapter_Abstract
Inherited_from
\Zend_Queue_Adapter_AdapterAbstract::$$_queue  
>VPropertyprotectedarray $_queues = array()
inherited
Internal array of queues to save on lookups
Inherited from: \Zend_Queue_Adapter_AdapterAbstract::$$_queues
Default valuearray()Details
Type
array
Inherited_from
\Zend_Queue_Adapter_AdapterAbstract::$$_queues  

Methods

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

Constructor

$options is an array of key/value pairs or an instance of Zend_Config containing configuration options. These options are common to most adapters:

See the Zend_Queue Adapter Notes documentation for example configurations.

Some options are used on a case-by-case basis by adapters:

access_key => (string) Amazon AWS Access Key secret_key => (string) Amazon AWS Secret Key dbname => (string) The name of the database to user username => (string) Connect to the database as this username. password => (string) Password associated with the username. host => (string) What host to connect to, defaults to localhost port => (string) The port of the database

Parameters
NameTypeDescription
$optionsarray | \Zend_Config
$queuenull | \Zend_Queue
Throws
ExceptionDescription
\Zend_Queue_Exception
methodpubliccount(\Zend_Queue | null $queue = null) : integer

Return the approximate number of messages in the queue

Parameters
NameTypeDescription
$queue\Zend_Queue | null
Returns
TypeDescription
integer
Throws
ExceptionDescription
\Zend_Queue_Exception- not supported.
methodpubliccreate(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.

Parameters
NameTypeDescription
$namestring

Queue name

$timeoutinteger

Default visibility timeout

Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Queue_Exception- not supported.
methodpublicdelete(string $name) : boolean

Delete a queue and all of it's messages

Return false if the queue is not found, true if the queue exists.

Parameters
NameTypeDescription
$namestring

Queue name

Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Queue_Exception- not supported.
methodpublicdeleteMessage(\Zend_Queue_Message $message) : boolean

Delete a message from the queue

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

Parameters
NameTypeDescription
$message\Zend_Queue_Message
Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Queue_Exception- not supported.
methodpublicgetCapabilities() : array

Return a list of queue capabilities functions

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

Returns
TypeDescription
array
methodpublicgetOptions() : array
inherited

Returns the configuration options in this adapter.

Inherited from: \Zend_Queue_Adapter_AdapterAbstract::getOptions()
Returns
TypeDescription
array
methodpublicgetQueue() : \Zend_Queue | null
inherited

get the Zend_Queue class that is attached to this object

Inherited from: \Zend_Queue_Adapter_AdapterAbstract::getQueue()
Returns
TypeDescription
\Zend_Queue | null
methodpublicgetQueues() : array

Get an array of all available queues

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

Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Queue_Exception- not supported.
methodpublicisExists(string $name) : boolean

Does a queue already exist?

Use isSupported('isExists') to determine if an adapter can test for queue existance.

Parameters
NameTypeDescription
$namestring

Queue name

Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Queue_Exception- not supported.
methodpublicisSupported(string $name) : boolean
inherited

Indicates if a function is supported or not.

Inherited from: \Zend_Queue_Adapter_AdapterAbstract::isSupported()
Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
boolean
methodpublicreceive(integer | null $maxMessages = null, integer | null $timeout = null, \Zend_Queue | null $queue = null) : \Zend_Queue_Message_Iterator

Get messages in the queue

Parameters
NameTypeDescription
$maxMessagesinteger | null

Maximum number of messages to return

$timeoutinteger | null

Visibility timeout for these messages

$queue\Zend_Queue | null
Returns
TypeDescription
\Zend_Queue_Message_Iterator
Throws
ExceptionDescription
\Zend_Queue_Exception- not supported.
methodpublicsend(mixed $message, \Zend_Queue | null $queue = null) : \Zend_Queue_Message

Send a message to the queue

Parameters
NameTypeDescription
$messagemixed

Message to send to the active queue

$queue\Zend_Queue | null
Returns
TypeDescription
\Zend_Queue_Message
Throws
ExceptionDescription
\Zend_Queue_Exception- not supported.
methodpublicsetQueue(\Zend_Queue $queue) : \Zend_Queue_Adapter_AdapterInterface
inherited

set the Zend_Queue class for this object

Inherited from: \Zend_Queue_Adapter_AdapterAbstract::setQueue()
Parameters
NameTypeDescription
$queue\Zend_Queue
Returns
TypeDescription
\Zend_Queue_Adapter_AdapterInterface
Documentation was generated by phpDocumentor 2.0.0a12.