#run-time #async #join #unblocking

bin+lib asyncra

Unblocking async runtime

2 unstable releases

new 0.1.0-beta Nov 24, 2024
0.0.0 Nov 23, 2024

#18 in #join

Download history 61/week @ 2024-11-17

64 downloads per month

Apache-2.0

14KB
178 lines

Crates.io Version Crates.io Downloads (latest version)

Here is Asyncra

Full unblocking async runtime


Example

use tokio::join;
use asyncra::SharedValue;

#[asyncra::main]
async fn main() -> asyncra::Result<()> {
    let num = SharedValue::new(12);
    let num_c = num.clone();
    let first = tokio::task::spawn( async move {
        for _ in 0..10 {
            let num_3 = num_c.read::<i32>().await;
            println!("Num now is: {num_3}");
        }
    });
    let second = tokio::task::spawn(async move {
        for _ in 0..10 {
            let num_ = num.read::<i32>().await;
            num.write(num_ + 1);
        }
    });
    join!(first, second);
    Ok(())
}

Installation

cargo add asyncra


TODO

  1. Add task and thread spawner
  2. Add join macros for launch parallel threads at the same time

License

Dependencies

~10–22MB
~308K SLoC