moirai-async 0.7.0

Async/await support for Moirai concurrency library
Documentation

moirai-async

crates.io docs.rs

Async runtime integration for the Moirai concurrency library — the concurrent domain, distinct from the synchronous data-parallel domain in moirai-parallel.

  • io — AsyncRead / AsyncWrite (signature-identical to futures-io) with AsyncReadExt / AsyncWriteExt, plus TokioCompat / MoiraiCompat bridges.
  • net — native TcpStream, TcpListener, UdpSocket, and connection pooling on Unix and Windows. Browser networking uses the WebSocket handles in moirai-pal.
  • fs — async file operations (read, write, File, FileOpenOptions, …), including exact cursor-preserving AsyncReadAt and AsyncLength access.
  • timer — sleep, timeout, interval, RateLimiter, TimerWheel.
  • sync — Mutex, RwLock, Semaphore, Notify, Broadcast, Watch.
  • executor — native AsyncExecutor and AsyncHandle.
[dependencies]
moirai-async = "0.5"
use std::time::Duration;

#[moirai_async::main]
async fn main() {
    moirai_async::sleep(Duration::from_millis(10)).await;
    println!("done");
}

The #[moirai_async::main] attribute (from moirai-async-macros) rewrites the function into a synchronous native main that builds a default AsyncExecutor and blocks on the body.

Full documentation: https://docs.rs/moirai-async

License

Licensed under either of Apache-2.0 or MIT at your option.