I am using tokio 0.2.x but I need to use a dependency that depends on hyper 0.12.35.
This result in SpawnError { is_shutdown: true }
panics.
I have managed to reproduce this in an isolated manner:
cargo.toml
[dependencies]
tokio = { version = "0.2.11", features = ["full"] }
hyper = "0.12.35"
futures = "0.1.29"
and this is the code:
use hyper::rt;
use futures::future as future01;
fn future_01() -> impl future01::Future<Item = (), Error = ()> {
future01::ok(())
}
#[tokio::main]
async fn main() -> Result<(), std::io::Error> {
rt::spawn(future_01());
Ok(())
}
My dependency has this rt::spawn
deep into the implementation so that I cannot modify that.
Ideally, I would like to set the default executor used by rt::spawn
to be the same as the one that tokio::main
provides. Is that possible?