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

Add a mechanism to allow interval timer cancellation #19

Closed
barbu110 opened this issue Aug 1, 2019 · 0 comments · Fixed by #21
Closed

Add a mechanism to allow interval timer cancellation #19

barbu110 opened this issue Aug 1, 2019 · 0 comments · Fixed by #21

Comments

@barbu110
Copy link
Owner

barbu110 commented Aug 1, 2019

Interval timers could be used for creating a retry mechanism. As an example, see the following scenario:

  • our callback function does some operation that might fail
  • we start an interval timer with microloop::timers::set_interval with callback callback to repeat the operation every X seconds until it succeeds.

Currently the until it succeeds part cannot be satisfied by the current API because the callback has no way of stopping the timer.

Changes in the API:

  • A TimerController class should be implemented with a cancel method.
  • The Timer callback should be called with this sole argument, an instance of TimerController constructed when the Timer is constructed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant