-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement periodic/looping tasks ♻️ (#8)
> Closes #5 This is an alternative implementation of what @CermakM proposed in #5 that retains the previous functionality (one-off task executions, hooks/observer methods, etc.) and adds a periodic/looping tasks on top of that. ### Some implementation notes: - the tasks are restarted immediately when the previous function's iteration returns. - if the task returns an error, retry policies are applied just like for one-off tasks. Retries happen within the same loop iteration. - if the retries are not successful, the observer's `OnTaskFailed()` method is called and a new loop starts again. - the `OnTaskStalled()` and `OnTaskSucceeded()` methods are ignored for loop tasks.
- Loading branch information
Showing
3 changed files
with
262 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.