<div align="center">
[](https://gitlab.com/cyloncore/yaaral/-/pipelines?ref=stable)
[](https://gitlab.com/cyloncore/yaaral/-/pipelines?ref=dev/1)
[](https://docs.rs/yaaral)
[](https://crates.io/crates/yaaral)
</div>
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](https://auksys.org/) and [CylonCore](https://cyloncore.com/) projects. Feel free to submit any pull requests for your own needs.
Compatibilities
---------------
| 0.2.x-0.3.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`:
```toml
yaaral = { version = "0.3", features = ["futures_runtime"] }
```
```rust
use yaaral::{Config, futures::Runtime, prelude::*};
let runtime = Runtime::new(Config::new().prefix("thread-name-"));
```
### tokio
* use the following for support with `tokio`:
```toml
yaaral = { version = "0.2", default-features = false, features = ["tokio_runtime"] }
```
In code, you can start a new runtime with:
```rust
use yaaral::{Config, tokio::Runtime, prelude::*};
let runtime = Runtime::new(Config::new().prefix("thread-name-"));
```
### bevy
* use the following for support with `tokio`:
```toml
yaaral = { version = "0.3", default-features = false, features = ["bevy_runtime"] }
```
```rust,no_run
let runtime = yaaral::bevy::async_compute_task_pool();
let runtime = yaaral::bevy::io_task_pool();
```