PHP 클래스 Resque_Job, php-resque

저자: Chris Boulton ([email protected])
파일 보기 프로젝트 열기: chrisboulton/php-resque 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$payload Array containing details of the job.
$queue The name of the queue that this job belongs to.
$worker Instance of the Resque worker running this job.

공개 메소드들

메소드 설명
__construct ( string $queue, array $payload ) Instantiate a new instance of a job.
__toString ( ) : string Generate a string representation used to describe the current job.
create ( string $queue, string $class, array $args = null, boolean $monitor = false, string $id = null ) : string Create a new job and save it to the specified queue.
fail ( $exception ) Mark the current job as having failed.
getArguments ( ) : array Get the arguments supplied to this job.
getInstance ( ) : Resque_JobInterface Get the instantiated object for this job that will be performing work.
getJobFactory ( ) : Resque_Job_FactoryInterface
getStatus ( ) : integer Return the status of the current job.
perform ( ) : boolean Actually execute a job by calling the perform method on the class associated with the job with the supplied arguments.
recreate ( ) : string Re-queue the current job.
reserve ( string $queue ) : false | object Find the next available job from the specified queue and return an instance of Resque_Job for it.
reserveBlocking ( array $queues, integer $timeout = null ) : false | object Find the next available job from the specified queues using blocking list pop and return an instance of Resque_Job for it.
setJobFactory ( Resque_Job_FactoryInterface $jobFactory ) : Resque_Job
updateStatus ( integer $status ) Update the status of the current job.

메소드 상세

__construct() 공개 메소드

Instantiate a new instance of a job.
public __construct ( string $queue, array $payload )
$queue string The queue that the job belongs to.
$payload array array containing details of the job.

__toString() 공개 메소드

Generate a string representation used to describe the current job.
public __toString ( ) : string
리턴 string The string representation of the job.

create() 공개 정적인 메소드

Create a new job and save it to the specified queue.
public static create ( string $queue, string $class, array $args = null, boolean $monitor = false, string $id = null ) : string
$queue string The name of the queue to place the job in.
$class string The name of the class that contains the code to execute the job.
$args array Any optional arguments that should be passed when the job is executed.
$monitor boolean Set to true to be able to monitor the status of a job.
$id string Unique identifier for tracking the job. Generated if not supplied.
리턴 string

fail() 공개 메소드

Mark the current job as having failed.
public fail ( $exception )
$exception

getArguments() 공개 메소드

Get the arguments supplied to this job.
public getArguments ( ) : array
리턴 array Array of arguments.

getInstance() 공개 메소드

Get the instantiated object for this job that will be performing work.
public getInstance ( ) : Resque_JobInterface
리턴 Resque_JobInterface Instance of the object that this job belongs to.

getJobFactory() 공개 메소드

public getJobFactory ( ) : Resque_Job_FactoryInterface
리턴 Resque_Job_FactoryInterface

getStatus() 공개 메소드

Return the status of the current job.
public getStatus ( ) : integer
리턴 integer The status of the job as one of the Resque_Job_Status constants.

perform() 공개 메소드

Actually execute a job by calling the perform method on the class associated with the job with the supplied arguments.
public perform ( ) : boolean
리턴 boolean

recreate() 공개 메소드

Re-queue the current job.
public recreate ( ) : string
리턴 string

reserve() 공개 정적인 메소드

Find the next available job from the specified queue and return an instance of Resque_Job for it.
public static reserve ( string $queue ) : false | object
$queue string The name of the queue to check for a job in.
리턴 false | object Null when there aren't any waiting jobs, instance of Resque_Job when a job was found.

reserveBlocking() 공개 정적인 메소드

Find the next available job from the specified queues using blocking list pop and return an instance of Resque_Job for it.
public static reserveBlocking ( array $queues, integer $timeout = null ) : false | object
$queues array
$timeout integer
리턴 false | object Null when there aren't any waiting jobs, instance of Resque_Job when a job was found.

setJobFactory() 공개 메소드

public setJobFactory ( Resque_Job_FactoryInterface $jobFactory ) : Resque_Job
$jobFactory Resque_Job_FactoryInterface
리턴 Resque_Job

updateStatus() 공개 메소드

Update the status of the current job.
public updateStatus ( integer $status )
$status integer Status constant from Resque_Job_Status indicating the current status of a job.

프로퍼티 상세

$payload 공개적으로 프로퍼티

Array containing details of the job.
public $payload

$queue 공개적으로 프로퍼티

The name of the queue that this job belongs to.
public $queue

$worker 공개적으로 프로퍼티

Instance of the Resque worker running this job.
public $worker