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
파일 보기 프로젝트 열기: phalcon/incubator 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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 @ [email protected]
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 @ [email protected]
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