Add support to listen to worker events
rodrigorm opened this issue · 3 comments
rodrigorm commented
When using then QueuesadillaShell
I need to listen to Worker
so I can react to some events in my CakePHP application.
rodrigorm commented
Maybe a mapper between League\Event
and Cake\Event
cleptric commented
This would definitely be something very useful.
We already talked about this topic before.
In the meantime, you can simply subclass the QueuesadillaShell
and override the QueuesadillaShell::getWorker
method.
public function getWorker($engine, $logger) {
$worker->attachListener('Worker.job.failure', function ($event) {
...
});
return $worker;
}
rodrigorm commented
This is what I will do for now. :)