Skip to content

Commit

Permalink
feat(rt): introduce rt::Executor trait
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
seanmonstar committed Dec 4, 2019
1 parent cb3f39c commit 6ae5889
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ default = [
]
runtime = [
"tcp",
"tokio/time",
"tokio/rt-core",
]
tcp = [
"net2",
Expand Down
3 changes: 0 additions & 3 deletions examples/single_threaded.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
fn main() {}
/*
#![deny(warnings)]

use std::cell::Cell;
Expand Down Expand Up @@ -74,4 +72,3 @@ where
tokio::task::spawn_local(fut);
}
}
*/
2 changes: 1 addition & 1 deletion src/rt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
//! If the `runtime` feature is disabled, the types in this module can be used
//! to plug in other runtimes.
//pub use crate::common::Executor;
pub use crate::common::Executor;

0 comments on commit 6ae5889

Please sign in to comment.