API Documentation

Zend/Queue.php

Show: inherited
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  
Version
$Id: Queue.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Queue

Package: Zend\Queue

Class for connecting to queues performing common operations.

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

Constants

Constant  TIMEOUT = 'timeout'

Use the TIMEOUT constant in the config of a Zend_Queue

Constant  VISIBILITY_TIMEOUT = 30

Default visibility passed to count

Constant  NAME = 'name'

Use the NAME constant in the config of Zend_Queue

Properties

Propertyprotected\Zend_Queue_Adapter_AdapterInterface  $_adapter= 'null'

Default valuenullDetails
Type
\Zend_Queue_Adapter_AdapterInterface
Propertyprotected\Zend_Log  $_logger= 'null'

Default valuenullDetails
Type
\Zend_Log
Propertyprotectedstring  $_messageClass= ''Zend_Queue_Message''

Zend_Queue_Message class

Default value'Zend_Queue_Message'Details
Type
string
Propertyprotectedstring  $_messageSetClass= ''Zend_Queue_Message_Iterator''

Zend_Queue_Message_Iterator class

Default value'Zend_Queue_Message_Iterator'Details
Type
string
Propertyprotectedarray  $_options= 'array()'

User-provided configuration

Default valuearray()Details
Type
array

Methods

methodpublic__construct( string|\Zend_Queue_Adapter|array|\Zend_Config|null $spec, \Zend_Config|array $options = array() ) : void

Constructor

Can be called as $queue = new Zend_Queue($config); - or - $queue = new Zend_Queue('array', $config); - or - $queue = new Zend_Queue(null, $config); // Zend_Queue->createQueue();

Parameters
Name Type Description
$spec string|\Zend_Queue_Adapter|array|\Zend_Config|null

String or adapter instance, or options array or Zend_Config instance

$options \Zend_Config|array

Zend_Config or a configuration array

methodprotected_setName( string $name ) : \Zend_Queue|false

Set the name of the queue

This is AN UNSUPPORTED FUNCTION

Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Queue|false Provides a fluent interface
methodpubliccount( ) : integer

Returns the approximate number of messages in the queue

Returns
Type Description
integer
methodpubliccreateQueue( string $name, integer $timeout = null ) : \Zend_Queue|false

Create a new queue

Parameters
Name Type Description
$name string

queue name

$timeout integer

default visibility timeout

Returns
Type Description
\Zend_Queue|false
Throws
Exception Description
\Zend_Queue_Exception
methodpublicdebugInfo( ) : array

returns a listing of Zend_Queue details.

useful for debugging

Returns
Type Description
array
methodpublicdeleteMessage( \Zend_Queue_Message $message ) : boolean

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
Name Type Description
$message \Zend_Queue_Message
Returns
Type Description
boolean
Throws
Exception Description
\Zend_Queue_Exception
methodpublicdeleteQueue( ) : boolean

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
Type Description
boolean
methodpublicgetAdapter( ) : \Zend_Queue_Adapter_AdapterInterface

Get the adapter for this queue

Returns
Type Description
\Zend_Queue_Adapter_AdapterInterface
methodpublicgetCapabilities( ) : array

Return a list of queue capabilities functions

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

Returns
Type Description
array
methodpublicgetMessageClass( ) : string

Returns
Type Description
string
methodpublicgetMessageSetClass( ) : string

Returns
Type Description
string
methodpublicgetName( ) : string

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
Type Description
string
methodpublicgetOption( string $name ) : null|mixed

Retrieve a single option

Parameters
Name Type Description
$name string
Returns
Type Description
null|mixed Returns null if option does not exist; option value otherwise
methodpublicgetOptions( ) : array

Returns the configuration options for the queue

Returns
Type Description
array
methodpublicgetQueues( ) : array

Get an array of all available queues

Returns
Type Description
array
Throws
Exception Description
\Zend_Queue_Exception
methodpublichasOption( string $name ) : bool

Determine if a requested option has been defined

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

Indicates if a function is supported or not.

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

Return the first element in the queue

Parameters
Name Type Description
$maxMessages integer
$timeout integer
Returns
Type Description
\Zend_Queue_Message_Iterator
methodpublicsend( mixed $message ) : \Zend_Queue_Message

Send a message to the queue

Parameters
Name Type Description
$message mixed

message

Returns
Type Description
\Zend_Queue_Message
Throws
Exception Description
\Zend_Queue_Exception
methodpublicsetAdapter( string|\Zend_Queue_Adapter_AdapterInterface $adapter ) : \Zend_Queue

Set the adapter for this queue

Parameters
Name Type Description
$adapter string|\Zend_Queue_Adapter_AdapterInterface
Returns
Type Description
\Zend_Queue Provides a fluent interface
methodpublicsetMessageClass( string $className ) : \Zend_Queue

Parameters
Name Type Description
$className string
Returns
Type Description
\Zend_Queue Provides a fluent interface
methodpublicsetMessageSetClass( string $className ) : \Zend_Queue

Parameters
Name Type Description
$className string
Returns
Type Description
\Zend_Queue Provides a fluent interface
methodpublicsetOption( string $name, mixed $value ) : \Zend_Queue

Set an individual configuration option

Parameters
Name Type Description
$name string
$value mixed
Returns
Type Description
\Zend_Queue
methodpublicsetOptions( array $options ) : \Zend_Queue

Set queue options

Parameters
Name Type Description
$options array
Returns
Type Description
\Zend_Queue
Documentation was generated by DocBlox 0.15.1.