michelsalib / BCCResqueBundle

The BCC resque bundle provides integration of php-resque to Symfony2. It is inspired from resque, a Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later.
122 stars 91 forks source link

Event for failed jobs? #113

Open epicwhale opened 10 years ago

epicwhale commented 10 years ago

Does this bundle provide a symfony2 dispatcher event or a mechanism where I can do something when a Job fails?

ruudk commented 10 years ago

Use a custom bootstrap that listens to Resque_Events (Resque_Event::listen)

ruudk commented 10 years ago

Example: https://gist.github.com/ruudk/a28319b83cb8a08fd979

epicwhale commented 10 years ago

@ruudk thanks for sharing.. two quick thoughts

  1. Can I access the symfony2 container here (in the custom bootstrap) by any chance? As I am using Ekino NewRelic Bundle and would like to access its services.
  2. It looks like you are using New Relic too.. your feedback on this on-going discussion with @danhunsaker would be insightful - https://github.com/chrisboulton/php-resque/issues/224