4 releases (stable)
Uses old Rust 2015
5.0.0 | Aug 14, 2018 |
---|---|
2.0.0 | Jun 24, 2018 |
1.0.0 | Jun 7, 2018 |
1.0.0-pre1 | May 28, 2018 |
12KB
221 lines
transportation
A callback wrapper around MIO.
lib.rs
:
This crate provides a thin callback wrapper around MIO. For each thread, a thread_local mio::Poll
is maintained. This poll can be accessed
with borrow_poll
. To listen for events on an Evented
, do the following:
use transportation::mio;
let token = transportation::insert_listener(|event| println!("Got event: {:?}"));
transportation::borrow_poll(|poll| poll.register(&evented, mio::Token(token), mio::Ready::readable(), mio::PollOpt::level()));
transportation::run();
Dependencies
~0.6–1MB
~14K SLoC