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 AbortOnDropHandle type #6786

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Conversation

barafael
Copy link
Contributor

wraps a JoinHandle, aborting the task on drop
Refs: #6224
Fixes: #6160

@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate M-task Module: tokio/task labels Aug 19, 2024
tokio-util/src/task/mod.rs Outdated Show resolved Hide resolved
tokio-util/src/task/spawn_abortable.rs Outdated Show resolved Hide resolved
tokio-util/src/task/spawn_abortable.rs Outdated Show resolved Hide resolved
@barafael barafael force-pushed the rb/abort_handle branch 2 times, most recently from 7e47811 to cf7cfd4 Compare August 19, 2024 12:45
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good.

tokio-util/src/task/abort_on_drop.rs Outdated Show resolved Hide resolved
tokio-util/src/task/mod.rs Outdated Show resolved Hide resolved
wraps a `JoinHandle`, aborting the task on drop

Co-authored-by: Alice Ryhl <aliceryhl@google.com>
Refs: tokio-rs#6224
Fixes: tokio-rs#6160
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@Darksonn Darksonn merged commit 1ac8dff into tokio-rs:master Aug 20, 2024
81 checks passed
@dev-ardi
Copy link

Thanks for finishing this!

@barafael
Copy link
Contributor Author

@dev-ardi thanks for starting it :)

@RangerMauve
Copy link

This is great, thank you!

@barafael barafael deleted the rb/abort_handle branch September 4, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate M-task Module: tokio/task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JoinHandle variant that abort on drop.
4 participants