wg-async
MIO
Our great sponsors
wg-async | MIO | |
---|---|---|
8 | 21 | |
365 | 6,064 | |
1.6% | 1.7% | |
5.9 | 8.5 | |
27 days ago | 14 days ago | |
Rust | Rust | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
wg-async
- Async Rust Is A Bad Language
-
Catch 22! Rust in Review
I believe the solution mentioned in rust-lang/wg-async is the way to go: Add traits like AsyncWrite, AsyncRead, Executor/Runtime to the std so that tokio/async-std can implement them.
-
Async Rust: What is a runtime? Here is how tokio works under the hood
This is a consequence of runtimes relying on global variables that their core future types are dependent on. Creating abstractions to solve this problem is one of the main goals of the the async working group [0].
[0]: https://github.com/rust-lang/wg-async
-
How should I structure an async/await/futures program with multiple event sources and mutable state?
Provided the futures you're selecting over are cancellation safe the plain loop over select! should be fine. Multiple channels in particular are safe to select over - if you have futures that aren't cancellation safe, you can just wrap them up in a task on the end of a channel and then select on that.
- Monoio – A thread-per-core Rust async runtime with io_uring
-
What Rust feature are you waiting for?
I'd like to be able to write runtime agnostic async libs.
-
Rust Weird Expressions
You might be interested in taking a look at and potentially participating in the "Async Vision Document"[1] which is an exercise the team is going through to collect feedback about the current state of the ecosystem and what the pain points are, as well as a way to lay doing what the desired future state of async Rust should be[2]. The process is happening, as you would expect, in the open and there's still time to influence it[3] if your concerns aren't yet addressed or even mentioned[4].
[1]: https://rust-lang.github.io/wg-async-foundations/vision.html
[2]: https://blog.rust-lang.org/2021/03/18/async-vision-doc.html
[3]: https://github.com/rust-lang/wg-async-foundations/pulls
[4]: https://github.com/rust-lang/wg-async-foundations/issues
-
Building a shared vision for Async Rust
Thanks for the feedback. I posted this comment to a relevant github issue, fyi.
MIO
-
What's the canonical way of doing it in rust?
Was playing around with mio (https://github.com/tokio-rs/mio) (not that mio itself is very important here!) and was trying to implement a simple something that I've done in java before: a Reactor that you can register ReactorClients with that will get callback whenever there are events on the corresponding socket etc.
-
RFC: A non-blocking networking library for Rust
How does it compare to mio?
-
How does the Rust mio crate implement deregistering connections?
TcpStream gets its wake behavior by delegating to the fd wakers. The Unix wakers have a few implementations, for different platforms. On Linux and Android, epoll is used.
-
Looking for Tokio's event loop source code
The real implementation details of the I/O event queue is done in mio as u/hniksic pointed out, but that's more comparable with libuv which is certainly a huge part of the Node runtime. mio and libuv have a lot of similarities (at least they used to).
-
Python multi-level break and continue
My example was "twice by one developer", not "twice across all indexed repos."
A spot check shows that quite a few in your link are used specifically to ensure correct handling of Rust multi-level breaks work syntax, like https://github.com/rust-lang/rust-analyzer/blob/master/crate... , https://github.com/rust-lang/rustfmt/blob/master/tests/sourc... , https://github.com/rust-lang/rust/blob/master/src/tools/rust... , https://github.com/rust-lang/rust/blob/master/src/tools/rust... and likely more.
Another is a translation of BASIC code to Rust, using break as a form of goto. https://github.com/coding-horror/basic-computer-games/blob/e...
The example at https://github.com/tokio-rs/mio/blob/master/tests/tcp.rs is a nice one
// Wait for our TCP stream to connect
-
Crates to help with event-loop type pattern?
In my program, I have about 6 different components that follow the pattern below. Basically, the components run a thread while polling on crossbeam channels, file descriptors or sockets. For polling, I am using Mio (https://github.com/tokio-rs/mio).
-
Ask HN: Has any Rust developer moved to embedded device programming?
On the code side it's pretty much the same as C++. You have a module that defines an interface and per-platform implementations that are included depending on a "configuration conditional checks" #[cfg(target_os = "linux")] macro.
https://github.com/tokio-rs/mio/blob/c6b5f13adf67483d927b176...
- Mio - Metal io library for rust
-
`wasm32-wasi` support added to Tokio
Made possible by Wasi support for Mio https://github.com/tokio-rs/mio/pull/1576
-
What is the point of async and await?
Indeed! In practice it's done through the polling operation: instead of a separate poll for op1 and op2, the program essentially tells the OS "wake me when either op1 or op2 is ready" (through the epoll syscall on Linux). The mio crate implements this, and the example on the readme is basically the same loop, but written with this polling strategy in mind.
What are some alternatives?
smol - A small and fast async runtime for Rust
tokio
ideas4 - An Additional 100 Ideas for Computing https://samsquire.github.io/ideas4/
rust-zmq - Rust zeromq bindings.
delimited
tokio - A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
miniserve - 🌟 For when you really just want to serve some files over HTTP right now!
glommio - Glommio is a thread-per-core crate that makes writing highly parallel asynchronous applications in a thread-per-core architecture easier for rustaceans.
rlimit - Resource limits
actix - Actor framework for Rust.
monoio - Rust async runtime based on io-uring.
message-io - Fast and easy-to-use event-driven network library.