Upgrade tokio to 1.10 (#9575)

* Upgrade tokio to 1.10

* Fix test runner

* Try fix it

* Update Cargo.lock

* Review feedback

* ahhhh

* FML

* FMT

* Fix tests
This commit is contained in:
Bastian Köcher
2021-08-24 16:31:19 +02:00
committed by GitHub
parent d722c44248
commit f92e5c5e65
24 changed files with 143 additions and 378 deletions
+3 -4
View File
@@ -73,8 +73,7 @@ where
/// Build a tokio runtime with all features
pub fn build_runtime() -> std::result::Result<tokio::runtime::Runtime, std::io::Error> {
tokio::runtime::Builder::new()
.threaded_scheduler()
tokio::runtime::Builder::new_multi_thread()
.on_thread_start(|| {
TOKIO_THREADS_ALIVE.inc();
TOKIO_THREADS_TOTAL.inc();
@@ -87,7 +86,7 @@ pub fn build_runtime() -> std::result::Result<tokio::runtime::Runtime, std::io::
}
fn run_until_exit<F, E>(
mut tokio_runtime: tokio::runtime::Runtime,
tokio_runtime: tokio::runtime::Runtime,
future: F,
task_manager: TaskManager,
) -> std::result::Result<(), E>
@@ -152,7 +151,7 @@ impl<C: SubstrateCli> Runner<C> {
/// A helper function that runs a node with tokio and stops if the process receives the signal
/// `SIGTERM` or `SIGINT`.
pub fn run_node_until_exit<F, E>(
mut self,
self,
initialize: impl FnOnce(Configuration) -> F,
) -> std::result::Result<(), E>
where