PHP 클래스 Resque\Queue

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

보호된 프로퍼티들

프로퍼티 타입 설명
$default The name of the default queue
$redis The Redis instance

공개 메소드들

메소드 설명
__construct ( string $default = null ) Create a new queue instance
job ( string $id ) : Job Get a job by id
later ( integer $delay, string $job, array $data = [], string $queue = null ) : Job Queue a job for later retrieval. Jobs are unique per queue and are deleted upon retrieval. If a given job (payload) already exists, it is updated with the new delay.
pop ( array $queues, integer $timeout = 10, boolean $blocking = true ) : Job | false Pop the next job off of the queue.
push ( string $job, array $data = null, string $queue = null ) : Job Push a new job onto the queue
redisKey ( Queue | null $queue = null, string | null $suffix = null ) : string Get the Queue key
size ( string $queue ) : integer Return the size (number of pending jobs) of the specified queue.
sizeDelayed ( string $queue ) : integer Return the size (number of delayed jobs) of the specified queue.

보호된 메소드들

메소드 설명
getQueue ( string | null $queue ) : string Get the queue or return the default.

메소드 상세

__construct() 공개 메소드

Create a new queue instance
public __construct ( string $default = null )
$default string Name of default queue to add job to

getQueue() 보호된 메소드

Get the queue or return the default.
protected getQueue ( string | null $queue ) : string
$queue string | null Name of queue
리턴 string

job() 공개 메소드

Get a job by id
public job ( string $id ) : Job
$id string Job id
리턴 Job job instance

later() 공개 메소드

Queue a job for later retrieval. Jobs are unique per queue and are deleted upon retrieval. If a given job (payload) already exists, it is updated with the new delay.
public later ( integer $delay, string $job, array $data = [], string $queue = null ) : Job
$delay integer This can be number of seconds or unix timestamp
$job string The job class
$data array The job data
$queue string The queue to add the job to
리턴 Job job instance

pop() 공개 메소드

Pop the next job off of the queue.
public pop ( array $queues, integer $timeout = 10, boolean $blocking = true ) : Job | false
$queues array Queues to watch for new jobs
$timeout integer Timeout if blocking
$blocking boolean Should Redis use blocking
리턴 Job | false

push() 공개 메소드

Push a new job onto the queue
public push ( string $job, array $data = null, string $queue = null ) : Job
$job string The job class
$data array The job data
$queue string The queue to add the job to
리턴 Job job instance

redisKey() 공개 정적인 메소드

Get the Queue key
public static redisKey ( Queue | null $queue = null, string | null $suffix = null ) : string
$queue Queue | null the worker to get the key for
$suffix string | null to be appended to key
리턴 string

size() 공개 메소드

Return the size (number of pending jobs) of the specified queue.
public size ( string $queue ) : integer
$queue string name of the queue to be checked for pending jobs
리턴 integer The size of the queue.

sizeDelayed() 공개 메소드

Return the size (number of delayed jobs) of the specified queue.
public sizeDelayed ( string $queue ) : integer
$queue string name of the queue to be checked for delayed jobs
리턴 integer The size of the delayed queue.

프로퍼티 상세

$default 보호되어 있는 프로퍼티

The name of the default queue
protected $default

$redis 보호되어 있는 프로퍼티

The Redis instance
protected $redis