-
Notifications
You must be signed in to change notification settings - Fork 270
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
fix(wasm): don't kill task on drop #4572
base: main
Are you sure you want to change the base?
Conversation
cc @jplatte |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4572 +/- ##
==========================================
- Coverage 85.39% 85.37% -0.02%
==========================================
Files 286 286
Lines 32229 32235 +6
==========================================
Hits 27522 27522
- Misses 4707 4713 +6 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Manmeet Singh <[email protected]>
3ebe4dc
to
3818d1c
Compare
#[cfg(target_arch = "wasm32")] | ||
impl<T> Drop for JoinHandle<T> { | ||
fn drop(&mut self) { | ||
// don't abort the spawned future |
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.
This comment must be elaborated to explain why we don't abort the future when the join handle is dropped:
- Why?
- Does it match the Tokio's behaviour?
Thanks.
Thanks for your contribution :-). It would be nice if you could address my comment, and if tests could be added. This is an important change. |
makes behavior similar to tokio::spawn otherwise spawned tasks immediately die if join handles are not saved somewhere