spawn_tracked

Function spawn_tracked 

Source
pub fn spawn_tracked<F, T>(name: T, future: F) -> Task<F::Output>
where F: Future + Send + 'static, F::Output: Send + 'static, T: Into<String>,
Expand description

Spawn a tracked task on the smol runtime

This function spawns a task and automatically tracks it in the global Inspector.

ยงExamples

use async_inspect::runtime::smol::spawn_tracked;

smol::block_on(async {
    let task = spawn_tracked("my_task", async {
        // Your async code here
        42
    });

    let result = task.await;
    println!("Result: {}", result);
});