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:
@@ -2,7 +2,6 @@
|
||||
extern crate futures;
|
||||
extern crate hyper;
|
||||
extern crate pretty_env_logger;
|
||||
extern crate tokio;
|
||||
extern crate url;
|
||||
|
||||
use futures::{future, Future, Stream};
|
||||
@@ -93,5 +92,5 @@ fn main() {
|
||||
.serve(|| service_fn(param_example))
|
||||
.map_err(|e| eprintln!("server error: {}", e));
|
||||
|
||||
tokio::run(server);
|
||||
hyper::rt::run(server);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user