Skip to content

Conversation

nickkuk
Copy link
Contributor

@nickkuk nickkuk commented Sep 8, 2025

New tokio_util::task::JoinDeque structure as FIFO-ordered analog of tokio::task::JoinSet.

Issue: #7576

/// When the `JoinDeque` is dropped, all tasks in the `JoinDeque` are
/// immediately aborted.
#[derive(Debug)]
pub struct JoinDeque<T>(VecDeque<JoinHandle<T>>);
Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines 24 to 30
impl<T> Drop for JoinDeque<T> {
fn drop(&mut self) {
for join_handle in self.0.drain(..) {
join_handle.abort();
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
impl<T> Drop for JoinDeque<T> {
fn drop(&mut self) {
for join_handle in self.0.drain(..) {
join_handle.abort();
}
}
}

See #7590 (comment)

@ADD-SP ADD-SP added C-enhancement Category: A PR with an enhancement or bugfix. A-tokio-util Area: The tokio-util crate M-task Module: tokio/task labels Sep 9, 2025
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 C-enhancement Category: A PR with an enhancement or bugfix. M-task Module: tokio/task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants