Skip to content

Commit 5db5c5c

Browse files
committed
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.
1 parent cb3f39c commit 5db5c5c

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ default = [
6060
]
6161
runtime = [
6262
"tcp",
63-
"tokio/time",
63+
"tokio/rt-core",
6464
]
6565
tcp = [
6666
"net2",

examples/single_threaded.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
fn main() {}
2-
/*
31
#![deny(warnings)]
42

53
use std::cell::Cell;
@@ -74,4 +72,3 @@ where
7472
tokio::task::spawn_local(fut);
7573
}
7674
}
77-
*/

src/rt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
//! If the `runtime` feature is disabled, the types in this module can be used
66
//! to plug in other runtimes.
77
8-
//pub use crate::common::Executor;
8+
pub use crate::common::Executor;

0 commit comments

Comments
 (0)