defunkt/resque — pull request #455 by yaauie (2011-11-18 19:27:32+00:00)
Title: add before_reporting_error hooks

Gives a job the ability to handle reporting itself to the failure backend on
its own, either in addition to or as a replacement to the existing process.

A plugin that I'm working on connects jobs together with metadata; when a
child job fails, the whole tree effectively fails. This patch gives us the
ability to report the root job failed to the backend, enabling swifter
recovery in Resque Web.

Others may find this useful to special-case certain job types to, for example,
report to some controller that the current worker is apparently over an
external API's rate limit, since the worker and current queue are both
available at this juncture.