scoped-join-set-0.4.0 has been yanked.
A scoped, lifetime-aware wrapper around [tokio::task::JoinSet].
ScopedJoinSet enables dynamically spawning async tasks whose futures are
tied to a specific Rust lifetime 'scope. This provides a safe alternative
to hand-managed unsafe approaches while enabling advanced async task
orchestration where futures do not need to be 'static.
Each spawned task is split into:
- A [
FutureHolder], owning the actual boxed future and ensuring proper drop ordering. - A [
WeakFuture] (inside theJoinSet), which the Tokio runtime polls.
When the [ScopedJoinSet] is dropped, all tasks are aborted and all future
memory is reclaimed safely.
Guarantees
- Futures spawned via [
ScopedJoinSet::spawn] cannot outlive'scope. join_next()is cancellation-safe.- Dropping the entire set aborts all tasks.
Example
use ScopedJoinSet;
async