mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-15 00:00:15 +02:00
e86fc4917afadbf3d1598a88693ea865befc1aa4
need_read and need_write to return an error
This commit is targeted at solving tokio-rs/tokio-core#12 and incorporates the solution from tokio-rs/tokio-core#17. Namely the `need_read` and `need_write` functions on `PollEvented` now return an error when the connected reactor has gone away and the task cannot be blocked. This will typically naturally translate to errors being returned by various connected I/O objects and should help tear down the world in a clean-ish fashion.
tokio-core
Core I/O and event loop abstraction for asynchronous I/O in Rust built on
futures and mio.
Usage
First, add this to your Cargo.toml:
[dependencies]
tokio-core = "0.1"
Next, add this to your crate:
extern crate tokio;
You can find extensive documentation and examples about how to use this crate
online at https://tokio.rs as well as the examples folder
in this repository. The API documentation is also
a great place to get started for the nitty-gritty.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in tokio by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Languages
Rust
100%