#mio #event-loop #stakker


Mio I/O polling integration for the Stakker crate

9 releases

0.2.2 May 14, 2021
0.2.1 Mar 18, 2021
0.2.0 Nov 8, 2020
0.1.3 Jul 14, 2020
0.0.1 Jan 23, 2020

#183 in Asynchronous

Download history 42/week @ 2021-04-03 35/week @ 2021-04-10 40/week @ 2021-04-17 37/week @ 2021-04-24 33/week @ 2021-05-01 31/week @ 2021-05-08 53/week @ 2021-05-15 26/week @ 2021-05-22 30/week @ 2021-05-29 36/week @ 2021-06-05 26/week @ 2021-06-12 30/week @ 2021-06-19 27/week @ 2021-06-26 27/week @ 2021-07-03 27/week @ 2021-07-10 53/week @ 2021-07-17

172 downloads per month
Used in stakker_tui


797 lines

Mio I/O polling integration for the Stakker crate

This integrates the mio crate with Stakker and makes handling mio sources more convenient.


See the crate documentation.


This project is licensed under either the Apache License version 2 or the MIT license, at your option. (See LICENSE-APACHE and LICENSE-MIT).


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


Integrates mio into Stakker.

MioPoll is the main type. It handles polling and converting mio events into Stakker forward calls. It offers priority levels to allow some events to take priority over others. In addition token cleanup is handled through drop handlers.

TcpStreamBuf makes it easier to do buffering for a mio::net::TcpStream.

FdSource wraps an arbitrary UNIX file descriptor for use with MioPoll.

All calls retry on ErrorKind::Interrupted internally, so this error doesn't have to be handled by the caller. Retrying is the most helpful behaviour in a non-blocking event loop. In an app using blocking I/O you might want a blocked call to be cut short on a signal, but that case doesn't apply here.

The mio version used by this library is re-exported as stakker_mio::mio. This should be used by applications in place of importing mio directly, to guarantee they're using the same version.


~21K SLoC