#run-time #applications #platform

nightly photonio

A runtime for asynchronous applications

2 releases

0.0.5 Nov 8, 2022
0.0.4 Oct 5, 2022
0.0.3 Oct 5, 2022
0.0.1 Jun 10, 2022

#1808 in Asynchronous

Download history 3/week @ 2024-02-14 40/week @ 2024-02-21 12/week @ 2024-02-28 4/week @ 2024-03-06 3/week @ 2024-03-13

62 downloads per month
Used in 2 crates

MIT license

21KB
487 lines

An efficient runtime for asynchronous applications.

There are two implementations of this runtime:

By default, this crate uses the photonio-uring implementation on Linux and the photonio-tokio implementation on other platforms. To use the photonio-tokio implementation on all platforms, enable the tokio feature.

Examples

use photonio::{
    fs::File,
    io::{Write, WriteAt},
};

#[photonio::main]
async fn main() -> std::io::Result<()> {
    let mut file = File::create("hello.txt").await?;
    file.write(b"hello").await?;
    file.write_at(b"world", 5).await?;
    Ok(())
}

Limitations

  • Dropping an unfinished future for asynchronous filesystem or networking operations will result in a panic. However, this behavior might be change in the future.
  • The current multi-thread runtime uses a naive round-robin fashion to schedule tasks. A work-stealing scheduler will be added in the future.

Dependencies

~1.1–9MB
~57K SLoC