scope-spawn 0.1.0

structured concurrency management for tokio tasks
Documentation

Spawn Scope

A small utility to manage spawned tokio tasks.

Usage

use scope_spawn::scope::Scope;

#[tokio::main]
async fn main() {
    let scope = Scope::new();
    scope.spawn(async {
        println!("Hello from a spawned task!");
    });
    // scope is dropped here, and spawned tasks are cancelled.
}

Examples

A simple example demonstrating basic usage with tokio can be found in examples/tokio_simple.rs. To run it:

cargo run --example tokio_simple

Testing

To run the tests, use the following command:

cargo test