feat(rt): introduce rt::Executor trait
The `hyper::rt::Executor` trait allows defining custom executors to be used with hyper's `Client` and `Server`. Closes #1944 BREAKING CHANGE: Any type passed to the `executor` builder methods must now implement `hyper::rt::Executor`. `hyper::rt::spawn` usage should be replaced with `tokio::task::spawn`. `hyper::rt::run` usage should be replaced with `#[tokio::main]` or managing a `tokio::runtime::Runtime` manually.
This commit is contained in:
@@ -60,7 +60,7 @@ default = [
|
|||||||
]
|
]
|
||||||
runtime = [
|
runtime = [
|
||||||
"tcp",
|
"tcp",
|
||||||
"tokio/time",
|
"tokio/rt-core",
|
||||||
]
|
]
|
||||||
tcp = [
|
tcp = [
|
||||||
"net2",
|
"net2",
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
fn main() {}
|
|
||||||
/*
|
|
||||||
#![deny(warnings)]
|
#![deny(warnings)]
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
@@ -74,4 +72,3 @@ where
|
|||||||
tokio::task::spawn_local(fut);
|
tokio::task::spawn_local(fut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|||||||
@@ -5,4 +5,4 @@
|
|||||||
//! If the `runtime` feature is disabled, the types in this module can be used
|
//! If the `runtime` feature is disabled, the types in this module can be used
|
||||||
//! to plug in other runtimes.
|
//! to plug in other runtimes.
|
||||||
|
|
||||||
//pub use crate::common::Executor;
|
pub use crate::common::Executor;
|
||||||
|
|||||||
Reference in New Issue
Block a user