selectme 0.4.0

A fast and fair select! macro for asynchronous Rust.
Documentation

selectme

A fast and fair select! implementation for asynchronous programming.

See the select! or inline! macros for documentation.

Usage

Add the following to your Cargo.toml:

selectme = "0.4.0"

Examples

The following is a simple example showcasing two branches being polled concurrently. For more documentation see select!.

async fn do_stuff_async() {
    // async work
}

async fn more_async_work() {
    // more here
}

#[tokio::main]
async fn main() {
    selectme::select! {
        _ = do_stuff_async() => {
            println!("do_stuff_async() completed first")
        }
        _ = more_async_work() => {
            println!("more_async_work() completed first")
        }
    };
}

License: MIT/Apache-2.0