![github] ![crates-io] ![docs-rs] ![license]
A simple single-threaded async runtime for Rust based on io_uring.
Async Rust doesn't need to be complicated, so Uringy is designed with simplicity as its main goal. At it's core there is a single-threaded event loop which handles concurrency without the complexity that comes with parallelism. This doesn't mean that you can't take advantage of multiple cores in your environment, runtimes can be run on several threads. Popular runtimes like NodeJS, Go, and Tokio use the epoll API, while Uringy uses the newer io_uring API for better performance.
Note that Uringy is a work in progress and shouldn't be used in production.
Install Rust and create a new cargo project.
Add uringy as a dependency to your Cargo.toml
:
toml
[dependencies]
uringy = "0.3.0"
Then replace src/main.rs
with:
```rust use uringy::runtime;
fn main() { // run async block to completion runtime::block_on(async { // create another task, will run concurrently with the current async block let handle = runtime::spawn(async { println!("world"); });
println!("hello");
handle.await.unwrap();
});
} ```
And run your project using: cargo run --release
If you're using macOS or Windows, run a Linux virtual machine or a docker container.
You might not need async Rust, using synchronous threads will get you pretty far. Async Rust might make a difference only when you outgrow threads and your program is IO bound.
Once you've decided on using async Rust, you should understand the basics of futures.
Then you should decide which async Runtime you want to use. For a serious project you should use Tokio. But since you're here, run the quick start and then check out the examples.
If you need to implement your own Future types, check out the source code for examples. I highly recommend Rust for Rustaceans to learn the theory.
The current MSRV is 1.58.1.
This project is licensed under the MIT license.