Skip to main content

Crate yaaral

Crate yaaral 

Source
Expand description

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

yaaralfuturestokiobevy
0.5.1-0.3.x1.x0.17.x-0.18.x (1)
0.5.00.3.x1.x0.17.x
0.2.x-0.4.x0.3.x1.x0.16.x
0.1.x0.3.x1.x-

1: bevy 0.18 support is available through the bevy_runtime_018 feature.

§How to use?

In cargo.toml:

§futures-executor

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

§tokio

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

In code, you can start a new runtime with:

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

§bevy

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

Modules§

prelude
Prelude for yaaral.

Structs§

Config
Configuration of a runtime
Infallible
Used when function actually never return an error

Traits§

CreationInterface
Full interface for Runtime, including creation
TaskHandle
Interface for a task
TaskInterface
Interface for managing task for runtimes
TaskReturnHandle
Allow to detach a Result<TaskHandle>