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

Too easy to cancel inactive Tasks #884

Closed
jstarry opened this issue Jan 19, 2020 · 0 comments · Fixed by #899
Closed

Too easy to cancel inactive Tasks #884

jstarry opened this issue Jan 19, 2020 · 0 comments · Fixed by #899

Comments

@jstarry
Copy link
Member

jstarry commented Jan 19, 2020

Problem
The Task interface has a method called cancel which is intended to allow devs to cancel long running tasks. However, this API is easy to misuse accidentally. For example, our examples encourage risky usage here and here. These are risky because the task should first be check using is_active() before canceling.

Related to #371

Proposed behavior
We should rely on Drop to cancel the task and remove the cancel method from the Task interface.

kakoc pushed a commit to kakoc/yew that referenced this issue Jan 26, 2020
In order to avoid misuse It was decided to remove `cancel` from `Task`
and delegate such logic to `Drop` stage.
kakoc added a commit to kakoc/yew that referenced this issue Jan 26, 2020
In order to avoid misuse It was decided to remove `cancel` from `Task` trait
and delegate such logic to `Drop`.
kakoc added a commit to kakoc/yew that referenced this issue Jan 26, 2020
In order to avoid misuse It was decided to remove `cancel` from `Task` trait
and delegate such logic to `Drop`.
kakoc added a commit to kakoc/yew that referenced this issue Jan 26, 2020
In order to avoid misuse It was decided to remove `cancel` from `Task` trait
and delegate such logic to `Drop`.
kakoc added a commit to kakoc/yew that referenced this issue Jan 27, 2020
In order to avoid misuse It was decided to remove `cancel` from `Task` trait
and delegate such logic to `Drop`.
jstarry pushed a commit that referenced this issue Jan 28, 2020
In order to avoid misuse It was decided to remove `cancel` from `Task` trait
and delegate such logic to `Drop`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant