chrisboulton/php-resque — pull request #212 by chrisboulton (2014-09-18 13:26:14+00:00)
Title: Add beforeEnqueue hook

Add a `beforeEnqueue` hook that's called before a job is placed on a queue. You can cancel the creation of a job by throwing `Resque_Job_DontCreate` in a hook/plugin.

This is basically #199, but works slightly differently (throws an exception). The changes in #199 have issues if multiple plugins are listening on the one event, and don't include tests.

The only thing I've not accounted for here is returning the not created status back to the caller. How do we want to handle this?

Ping @wedy & @danhunsaker