#io #non-blocking #async #future #tokio

arta-tokio

Async abstractions implementation for Tokio

2 unstable releases

0.2.1 Jul 19, 2024
0.2.0 Jul 4, 2024
0.1.1 Jul 1, 2024
0.1.0 Jul 1, 2024

#719 in Asynchronous

Download history 216/week @ 2024-06-27 167/week @ 2024-07-04 3/week @ 2024-07-11 116/week @ 2024-07-18 142/week @ 2024-07-25 22/week @ 2024-08-01

144 downloads per month

MIT license

89KB
1.5K SLoC

arta

Arta is an asynchronous runtime abstractions library for Rust, designed to provide a flexible and powerful interface for building asynchronous applications. With arta, you can abstract over different async runtimes, making your code async runtime agnostic.

Features

  • Easy Integration: Seamlessly integrate with existing async codebases.
  • Flexible API: Use a consistent API regardless of the underlying runtime.
  • Lightweight: No overhead, designed for performance.

Installation

Add arta to your Cargo.toml:

[dependencies]
arta = "0.1.0"

lib.rs:

arta-tokio

Arta-tokio is a crate that provides an implementation of arta abstractions for Tokio runtime.

Installation

Add a following dependencies to your Cargo.toml:

[dependencies]
arta-tokio = "0.1.0"
arta = "0.1.0"
tokio = { version = "^1", features = ["full"] }

Usage

#[tokio::main]
async fn main() {
    // After tokio runtime was initialized just call methods on `TokioGlobalRuntime` to use
    // this crate.
    // Example:
    let hosts = TokioGlobalRuntime.read_to_string("/etc/hosts").await.unwrap();
    println!("Hosts: {hosts}");
}

Dependencies

~3–11MB
~105K SLoC