feat(rt): make tokio runtime optional
A Cargo feature `runtime` is added, which is enabled by default, that includes the following: - The `client::HttpConnector`, which uses `tokio::net::TcpStream`. - The `server::AddrStream`, which uses `tokio::net::TcpListener`. - The `hyper::rt` module, which includes useful utilities to work with the runtime without needing to import `futures` or `tokio` explicity. Disabling the feature removes many of these niceties, but allows people to use hyper in environments that have an alternative runtime, without needing to download an unused one.
This commit is contained in:
11
src/rt.rs
Normal file
11
src/rt.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
//! Default runtime
|
||||
//!
|
||||
//! By default, hyper includes the [tokio](https://tokio.rs) runtime. To ease
|
||||
//! using it, several types are re-exported here.
|
||||
//!
|
||||
//! The inclusion of a default runtime can be disabled by turning off hyper's
|
||||
//! `runtime` Cargo feature.
|
||||
|
||||
pub use futures::{Future, Stream};
|
||||
pub use futures::future::{lazy, poll_fn};
|
||||
pub use tokio::{run, spawn};
|
||||
Reference in New Issue
Block a user