PHP Класс Phalcon\Queue\Beanstalk\Extended

Extended class to access the beanstalk queue service. Supports tubes prefixes, pcntl-workers and tubes stats.
Наследование: extends Phalcon\Queue\Beanstalk
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$logger Phalcon\Logger\Adapter If provided the errors will be logged here.
$tubePrefix string Tubes prefix.
$workers array Queue handlers.

Открытые методы

Метод Описание
__construct ( array $options = null )
addWorker ( string $tube, callable $callback ) Adds new worker to the pool.
doWork ( boolean $ignoreErrors = false ) Runs the main worker cycle.
getJobStats ( integer $job_id ) : null | array Returns information about specified job if it exists
getTubeStats ( string $tube ) : null | array Returns information about the specified tube if it exists.
getTubes ( ) : array Returns the names of all tubes on the server.
ignoreTube ( string $tube ) : null | array Returns the number of tube watched by current session.
putInTube ( string $tube, string $data, array $options = null ) : boolean | string Puts a job on the queue using specified tube.
reserveFromTube ( string $tube, integer $timeout = null ) : boolean | Phalcon\Queue\Beanstalk\Job Reserves/locks a ready job from the specified tube.

Защищенные методы

Метод Описание
getResponseLines ( string $cmd ) : array | null Returns the result of command that wait the list in response from beanstalkd.
getTubeName ( string | null $tube ) : string Returns the tube name with prefix.
getWatchingResponse ( string $cmd ) : string | null Returns the result of command that wait the list in response from beanstalkd.

Описание методов

__construct() публичный метод

public __construct ( array $options = null )
$options array

addWorker() публичный метод

Adds new worker to the pool.
public addWorker ( string $tube, callable $callback )
$tube string
$callback callable

doWork() публичный метод

Runs the main worker cycle.
public doWork ( boolean $ignoreErrors = false )
$ignoreErrors boolean

getJobStats() публичный метод

Returns information about specified job if it exists
public getJobStats ( integer $job_id ) : null | array
$job_id integer
Результат null | array

getResponseLines() защищенный метод

Returns the result of command that wait the list in response from beanstalkd.
protected getResponseLines ( string $cmd ) : array | null
$cmd string
Результат array | null

getTubeName() защищенный метод

Returns the tube name with prefix.
protected getTubeName ( string | null $tube ) : string
$tube string | null
Результат string

getTubeStats() публичный метод

Returns information about the specified tube if it exists.
public getTubeStats ( string $tube ) : null | array
$tube string
Результат null | array

getTubes() публичный метод

Returns the names of all tubes on the server.
public getTubes ( ) : array
Результат array

getWatchingResponse() защищенный метод

Added on 10-Jan-2014 20:04 IST by Tapan Kumar Thapa @ tapan.thapa@yahoo.com
protected getWatchingResponse ( string $cmd ) : string | null
$cmd string
Результат string | null

ignoreTube() публичный метод

Example return array: ['WATCHED' => 1] Added on 10-Jan-2014 20:04 IST by Tapan Kumar Thapa @ tapan.thapa@yahoo.com
public ignoreTube ( string $tube ) : null | array
$tube string
Результат null | array

putInTube() публичный метод

Puts a job on the queue using specified tube.
public putInTube ( string $tube, string $data, array $options = null ) : boolean | string
$tube string
$data string
$options array
Результат boolean | string job id or false

reserveFromTube() публичный метод

Reserves/locks a ready job from the specified tube.
public reserveFromTube ( string $tube, integer $timeout = null ) : boolean | Phalcon\Queue\Beanstalk\Job
$tube string
$timeout integer
Результат boolean | Phalcon\Queue\Beanstalk\Job

Описание свойств

$logger защищенное свойство

If provided the errors will be logged here.
protected Adapter,Phalcon\Logger $logger
Результат Phalcon\Logger\Adapter

$tubePrefix защищенное свойство

Tubes prefix.
protected string $tubePrefix
Результат string

$workers защищенное свойство

Queue handlers.
protected array $workers
Результат array