mirror of
https://github.com/idanoo/php-resque
synced 2025-07-02 06:02:21 +00:00
add beforeEnqueue hook that allows the enqueue to be cancelled
This commit is contained in:
parent
c335bc3555
commit
a95c24b32e
5 changed files with 106 additions and 29 deletions
12
README.md
12
README.md
|
@ -413,6 +413,18 @@ Called whenever a job fails. Arguments passed (in this order) include:
|
|||
* Exception - The exception that was thrown when the job failed
|
||||
* Resque_Job - The job that failed
|
||||
|
||||
#### beforeEnqueue ####
|
||||
|
||||
Called immediately before a job is enqueued using the `Resque::enqueue` method.
|
||||
Arguments passed (in this order) include:
|
||||
|
||||
* Class - string containing the name of the job to be enqueued
|
||||
* Arguments - array of arguments for the job
|
||||
* Queue - string containing the name of the queue the job is to be enqueued in
|
||||
* ID - string containing the token of the job to be enqueued
|
||||
|
||||
You can prevent enqueing of the job by throwing an exception of `Resque_Job_DontCreate`.
|
||||
|
||||
#### afterEnqueue ####
|
||||
|
||||
Called after a job has been queued using the `Resque::enqueue` method. Arguments passed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue