Interface craft\queue\QueueInterface
- Implemented by
- craft\queue\Queue
- Available since version
- 3.0
- Source Code
- https://github.com/craftcms/cms/blob/master/src/queue/QueueInterface.php
QueueInterface defines the common interface to be implemented by queue classes.
A class implementing this interface should also use \craft\queue\SavableComponentTrait and \craft\queue\JobTrait.
Method | Description | Defined By |
---|---|---|
getHasReservedJobs() |
Returns whether there are any reserved jobs | craft\queue\QueueInterface |
getHasWaitingJobs() |
Returns whether there are any waiting jobs | craft\queue\QueueInterface |
getJobInfo() |
Returns info about the jobs in the queue. | craft\queue\QueueInterface |
release() |
Releases a job from the queue. | craft\queue\QueueInterface |
retry() |
Re-adds a failed job to the queue. | craft\queue\QueueInterface |
run() |
Runs all the queued-up jobs | craft\queue\QueueInterface |
setProgress() |
Sets the progress for the currently reserved job. | craft\queue\QueueInterface |
Method Details
getHasReservedJobs()
public abstract method
#
Returns whether there are any reserved jobs
public abstract boolean getHasReservedJobs ( )
getHasWaitingJobs()
public abstract method
#
Returns whether there are any waiting jobs
public abstract boolean getHasWaitingJobs ( )
getJobInfo()
public abstract method
#
Returns info about the jobs in the queue.
The response array should have sub-arrays with the following keys:
- 'id': The job ID
- 'status': The job status (1 = waiting, 2 = reserved, 3 = done, 4 = failed)
- 'progress': The job progress (0-100)
- 'description': The job description
- 'error': The error message (if the job failed)
public abstract array getJobInfo ( \craft\queue\int $limit = null )
$limit |
integer, null |
release()
public abstract method
#
Releases a job from the queue.
public abstract void release ( \craft\queue\string $id )
$id |
string |
retry()
public abstract method
#
Re-adds a failed job to the queue.
public abstract void retry ( \craft\queue\string $id )
$id |
string |
run()
public abstract method
#
Runs all the queued-up jobs
public abstract void run ( )
setProgress()
public abstract method
#
Sets the progress for the currently reserved job.
public abstract void setProgress ( \craft\queue\int $progress )
$progress |
integer | The job progress (1-100) |