#run-time #async #non-blocking #io #future

tinyio

A tiny Rust concurrency runtime library

1 unstable release

0.1.0 Apr 26, 2024

#876 in Asynchronous

Download history 120/week @ 2024-04-25

120 downloads per month

MIT license

18KB
295 lines

TinyIO

A tiny Rust concurrency runtime library.

Example

Print in parallel

#[tinyio::main]
async fn main() {
    for i in 0..10 {
        tinyio::spawn(async move {
            println!("{}", i);
        })
    }
}

Make HTTP/HTTPS requests

#[tinyio::main]
async fn main() {
    let mut res =
        isahc::get_async("https://raw.githubusercontent.com/levinion/tinyio/main/README.md")
            .await
            .unwrap();
    println!("{}", res.text().await.unwrap());
}

Dependencies

~0.7–1.3MB
~27K SLoC