asyncra

Crates.ioasyncra
lib.rsasyncra
version
sourcesrc
created_at2024-11-23 18:39:34.406223
updated_at2024-11-27 19:01:18.591987
descriptionUnblocking async runtime
homepage
repository
max_upload_size
id1458637
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
still working... (europeDreadlyDevil)

documentation

README

Crates.io Version Crates.io Total Downloads

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

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

License

Commit count: 0

cargo fmt