yaaral 0.2.0

yet another async runtime abstraction library
Documentation

stable pipeline stable pipeline docs crates.io

yaaral: yet another async runtime abstraction library

yaaral is an abstraction to select between the runtime of tokio, futures-executor and std-async. Its development is driven by the need of the auKsys and CylonCore projects. Feel free to submit any pull requests for your own needs.

Compatibilities

yaaral futures tokio bevy
0.2.x 0.3.x 1.x 0.16.x
0.1.x 0.3.x 1.x -

How to use?

In cargo.toml:

futures-executor

  • use the following for support with futures-executor:
yaaral = { version = "0.2", features = ["futures_executor"] }
use yaaral::{Config, futures::Runtime, prelude::*};
let runtime = Runtime::new(Config::new().name("thread-name-"));

tokio

  • use the following for support with tokio:
yaaral = { version = "0.2", default-features = false, features = ["tokio"] }

In code, you can start a new runtime with:

use yaaral::{Config, tokio::Runtime, prelude::*};
let runtime = Runtime::new(Config::new().name("thread-name-"));

bevy

  • use the following for support with tokio:
yaaral = { version = "0.2", default-features = false, features = ["bevy"] }
let runtime = yaaral::bevy::async_compute_task_pool();
let runtime = yaaral::bevy::io_task_pool();