scoped-join-set 0.4.2

A scoped variant of tokio::task::JoinSet for spawning non-'static futures.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use scoped_join_set::{JoinError, ScopedJoinSet};

#[tokio::test]
async fn panicking_task() {
    let mut set = ScopedJoinSet::new();

    set.spawn(async {
        panic!("test panic");
    });

    let res = set.join_next().await;
    assert!(
        matches!(res, Some(Err(JoinError::Panicked(_)))),
        "Panicking task should return JoinError::Panicked"
    );
}