use std::time::Duration; fn main() -> Result<(), Box> { jive::block_on(async { println!("hewwo"); let handles = (0..10) .map(|i| { jive::spawn(async move { let handles = (1..=10) .map(|j| { jive::spawn_local(async move { jive::time::sleep(Duration::from_secs(2)).await; println!("{} slept", i * 10 + j); }) }) .collect::>(); for handle in handles { handle.await?; } println!("{i} joined"); Ok(()) as Result<_, jive::task::sync::JoinError> }) }) .collect::>(); for handle in handles { handle.await??; } println!("all joined"); Ok(()) }) }