API Documentation

Queue/Adapter/AdapterAbstract.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-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Queue  
subpackage
Adapter  
version
$Id: AdapterAbstract.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Queue_Adapter_AdapterAbstract

Class for connecting to queues performing common operations.

Implements
\Zend_Queue_Adapter_AdapterInterface
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Queue  
subpackage
Adapter  

Constants

Constant  CREATE_TIMEOUT_DEFAULT = '30'

Default timeout for createQueue() function

Constant  RECEIVE_TIMEOUT_DEFAULT = '30'

Default timeout for recieve() function

Properties

Propertyprotectedarray  $_options= 'array'

User-provided options

Default valuearrayDetails
Type
array
Propertyprotected\Zend_Queue_Adapter_Abstract  $_queue= 'null'

Contains the Zend_Queue that this object

Default valuenullDetails
Type
\Zend_Queue_Adapter_Abstract
Propertyprotectedarray  $_queues= 'array'

Internal array of queues to save on lookups

Default valuearrayDetails
Type
array

Methods

methodpublic__construct(  $options, \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
Name Type Description
$options
$queue \Zend_Queue The Zend_Queue object that created this class
Throws
Exception Description
\Zend_Queue_Exception
methodpubliccount( \Zend_Queue|null $queue = null ) : integer

Return the approximate number of messages in the queue

Inherited from: \Zend_Queue_Adapter_AdapterInterface::count()
Parameters
Name Type Description
$queue \Zend_Queue|null
Returns
Type Description
integer
methodpubliccreate( string $name, integer $timeout = null ) : boolean

Create a new queue

Inherited from: \Zend_Queue_Adapter_AdapterInterface::create()

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
Returns
Type Description
boolean
methodpublicdelete( string $name ) : boolean

Delete a queue and all of its messages

Inherited from: \Zend_Queue_Adapter_AdapterInterface::delete()

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

Parameters
Name Type Description
$name string Queue name
Returns
Type Description
boolean
methodpublicdeleteMessage( \Zend_Queue_Message $message ) : boolean

Delete a message from the queue

Inherited from: \Zend_Queue_Adapter_AdapterInterface::deleteMessage()

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

Parameters
Name Type Description
$message \Zend_Queue_Message
Returns
Type Description
boolean
methodpublicgetCapabilities( ) : array

Return a list of queue capabilities functions

Inherited from: \Zend_Queue_Adapter_AdapterInterface::getCapabilities()

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

Returns
Type Description
array
methodpublicgetOptions( ) : array

Returns the configuration options in this adapter.

Returns
Type Description
array
methodpublicgetQueue( ) : \Zend_Queue|null

get the Zend_Queue class that is attached to this object

Returns
Type Description
\Zend_Queuenull
methodpublicgetQueues( ) : array

Get an array of all available queues

Inherited from: \Zend_Queue_Adapter_AdapterInterface::getQueues()

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

Returns
Type Description
array
methodpublicisExists( string $name ) : boolean

Does a queue already exist?

Inherited from: \Zend_Queue_Adapter_AdapterInterface::isExists()

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

Parameters
Name Type Description
$name string Queue name
Returns
Type Description
boolean
methodpublicisSupported( string $name ) : boolean

Indicates if a function is supported or not.

Parameters
Name Type Description
$name string
Returns
Type Description
boolean
methodpublicreceive( integer|null $maxMessages = null, integer|null $timeout = null, \Zend_Queue|null $queue = null ) : \Zend_Queue_Message_Iterator

Get messages in the queue

Inherited from: \Zend_Queue_Adapter_AdapterInterface::receive()
Parameters
Name Type Description
$maxMessages integer|null Maximum number of messages to return
$timeout integer|null Visibility timeout for these messages
$queue \Zend_Queue|null
Returns
Type Description
\Zend_Queue_Message_Iterator
methodpublicsend( mixed $message, \Zend_Queue|null $queue = null ) : \Zend_Queue_Message

Send a message to the queue

Inherited from: \Zend_Queue_Adapter_AdapterInterface::send()
Parameters
Name Type Description
$message mixed Message to send to the active queue
$queue \Zend_Queue|null
Returns
Type Description
\Zend_Queue_Message
methodpublicsetQueue( \Zend_Queue $queue ) : \Zend_Queue_Adapter_AdapterInterface

set the Zend_Queue class for this object

Parameters
Name Type Description
$queue \Zend_Queue
Returns
Type Description
\Zend_Queue_Adapter_AdapterInterface
Documentation was generated by DocBlox 0.13.3.