Closed as not planned
Description
Description
I know when using the scheduler with messenger, you can use worker message events but I wonder if we should add scheduler-specific events? The stand-alone Scheduler
could benefit.
Example
I think it could be nice DX to define events when defining your schedule:
public function getSchedule(): Schedule
{
return (new Schedule())
->add(RecurringMessage::cron('* * * * *', new DoSomething()))
->before(function(PreRunEvent $event) {})
->after(function(PostRunEvent $event) {})
->onFailure(function(FailureEvent $event) {})
// maybe some out of the box helpers
->emailOnFailure(...) // uses symfony/mailer
->notifyOnFailure(...) // uses symfony/notifier
->pingBefore('https://some-uptime-service.com/oihjnjf8sd')
->pingAfter('https://some-uptime-service.com/jdhdud832hd')
->pingOnFailure('https://some-uptime-service.com/8978df7d')
;
}