MIO
message-io
Our great sponsors
MIO | message-io | |
---|---|---|
21 | 15 | |
6,064 | 1,031 | |
1.7% | - | |
8.5 | 5.8 | |
14 days ago | 3 months ago | |
Rust | Rust | |
MIT License | Apache License 2.0 |
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.
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.
message-io
-
Looking for help deciding which library to use for networking
message-io: a networking library meant to be very simple, built on mio.
-
Crate to build network packets over UDP
Another one I know about, but have not looked into yet, is message-io.
- Is there a proper websockets server framework in Rust?
-
Netty-rs - small rust library to easily write server/client networking protocols at application level
I'm working in a transport network library that possible fits as a building block for yours and solves the problem of using different underlying transports: message-io
-
Announcing message-io 0.12 - an event-driven message library to build network applications easy and fast. Now with zero-copy write/read messages. Performance close to using native OS socket with all the facilities the library offers.
Here is benchmarks
-
Someone built a chat backend with Rust for a production website?
I think https://github.com/lemunozm/message-io can be a good candidate.
-
message-io: an event-driven message library to build network applications easy and fast. Now with WebSocket support
The idea behind message-io is not to populate a current transport with a lot of options/profiles/modifications... this obfuscates the default way of working with it. Instead, if you want to build some behaviour on top of it, it is as easy as making an adapter! Following this pattern, you can split the way of using the library from the behaviour of the transport, keeping the things simple.
-
termchat: Terminal chat application on LAN with file transfer and ASCII webcam video streaming support. Built on top of tui-rs and message-io crates
The initial purpose was to show the capabilities of https://github.com/lemunozm/message-io Nevertheless, Termchat is growing and needs to polish some of its features. At this point it is not for real-world use but I hope to reach this target.
What are some alternatives?
tokio
Netty - Netty project - an event-driven asynchronous network application framework
rust-zmq - Rust zeromq bindings.
tungstenite-rs - Lightweight stream-based WebSocket implementation for Rust.
tokio - A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
laminar - A simple semi-reliable UDP protocol for multiplayer games
glommio - Glommio is a thread-per-core crate that makes writing highly parallel asynchronous applications in a thread-per-core architecture easier for rustaceans.
actix - Actor framework for Rust.
criterion.rs - Statistics-driven benchmarking library for Rust
libpnet - Cross-platform, low level networking using the Rust programming language.
ws-rs - Lightweight, event-driven WebSockets for Rust.