Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement periodic/looping tasks ♻️ #8

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

robertrossmann
Copy link
Member

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.

@robertrossmann robertrossmann added the enhancement New feature or request label Mar 6, 2024
@robertrossmann robertrossmann requested a review from a team March 6, 2024 14:42
@robertrossmann robertrossmann self-assigned this Mar 6, 2024
@robertrossmann robertrossmann merged commit f92f839 into master Mar 8, 2024
2 checks passed
@robertrossmann robertrossmann deleted the feat/looping-tasks branch March 8, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant