-
-
Notifications
You must be signed in to change notification settings - Fork 533
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
Allow canceling a timer #1478
Allow canceling a timer #1478
Conversation
Looks good. Thanks for picking this up so quickly 👍 |
@falkoschindler I would like to use |
@rodja First I chose |
Ok. |
I like |
Cool @natankeddem. I'm also in favour of |
I was about to push a commit renaming But the demo feels weird: Other example: In a code-review, would you really say "Oh, we need to destroy the timer when the user clicks this button"? I think I would say "cancel" even though I would be writing "destroy". That's not a good sign. |
In async frameworks tasks that are interrupted before finishing and in general cannot be resumed, the term 'cancelled' is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm now convinced .cancel()
is the right name for it.
As requested in #1477, this PR adds the possibility to cancel a timer.
This stops the infinite while loop. Afterwards the timer cannot be activated again.