Update tokio to 0.2 again and remove TaskExecutors (#786)

* upgrade tokio again

* Remove WrappedExecutor

* switch to spawn_blocking
This commit is contained in:
Ashley
2020-01-29 12:13:47 +01:00
committed by GitHub
parent aa86197ec9
commit 04eae615b5
14 changed files with 63 additions and 134 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ polkadot-network = { path = "../network" }
polkadot-validation = { path = "../validation" }
polkadot-service = { path = "../service" }
log = "0.4.8"
tokio = "0.1.22"
futures-timer = "1.0"
tokio = "0.2.10"
futures-timer = "2.0"
codec = { package = "parity-scale-codec", version = "1.1.0" }
[dev-dependencies]
+4 -4
View File
@@ -62,7 +62,7 @@ use polkadot_primitives::{
}
};
use polkadot_cli::{
ProvideRuntimeApi, AbstractService, ParachainHost, IsKusama, WrappedExecutor,
ProvideRuntimeApi, AbstractService, ParachainHost, IsKusama,
service::{self, Roles, SelectChain}
};
use polkadot_network::validation::{LeafWorkParams, ValidationNetwork};
@@ -308,7 +308,7 @@ fn run_collator_node<S, E, P, Extrinsic>(
Extrinsic: service::Codec + Send + Sync + 'static,
{
let runtime = tokio::runtime::Runtime::new().map_err(|e| format!("{:?}", e))?;
let spawner = WrappedExecutor(service.spawn_task_handle());
let spawner = service.spawn_task_handle();
let client = service.client();
let network = service.network();
@@ -427,7 +427,7 @@ fn run_collator_node<S, E, P, Extrinsic>(
);
let exit = inner_exit_2.clone();
tokio::spawn(future::select(res.boxed(), exit).map(drop).map(|_| Ok(())).compat());
tokio::spawn(future::select(res.boxed(), exit));
});
}
future::ok(())
@@ -450,7 +450,7 @@ fn run_collator_node<S, E, P, Extrinsic>(
inner_exit.clone()
).map(drop);
tokio::spawn(future.map(|_| Ok(())).compat());
tokio::spawn(future);
}
}.boxed();