3 unstable releases
0.1.0 | Nov 27, 2024 |
---|---|
0.1.0-beta | Nov 24, 2024 |
0.0.0 | Nov 23, 2024 |
#135 in #node
376 downloads per month
15KB
223 lines
Here is Asyncra
Full unblocking async runtime
Example
use asyncra::SharedValue;
#[asyncra::main]
async fn main() -> asyncra::Result<()> {
let num = SharedValue::new(12);
let num_c = num.clone();
asyncra::spawn_node( async move {
for _ in 0..10 {
let num_3 = num_c.read::<i32>().await;
println!("Num now is: {num_3}");
}
Ok(())
});
asyncra::spawn_node(async move {
for _ in 0..10 {
let num_ = num.read::<i32>().await;
num.write(num_ + 1);
}
Ok(())
});
Ok(())
}
Installation
cargo add asyncra
TODO
- Add task and thread spawner
- Add join macros for launch parallel threads at the same time
License
Dependencies
~11–23MB
~327K SLoC