fluentscheduler / FluentScheduler

Automated job scheduler with fluent interface for the .NET platform.
Other
2.68k stars 410 forks source link

[Feature] Schedule next run (execution) inside Execute method #323

Closed ghost closed 1 year ago

ghost commented 2 years ago

It would be useful to have a Registry method that would allow us to schedule an initialized IJob method to run at a different delayed interval. Why this is useful? So for example, let's say there's a condition inside the Execute method that would want to postpone the next execution by a minute because of a match for a specific entity which until then it won't match again. I'll take a concrete example, one of my oss projects is LivePlaylistsClone. So, inside the project i'm monitoring a radio station for songs. The thing is, when there's a match for a song on the first 30 seconds to it, I could postpone the next execution by a minute or two until the song ends so it won't collide with the same song again (even though I developed a mechanism for this which isn't 100% bulletproof) in the playlist.