Use ThreadPool::spawn_ok() instead of ThreadPool::spawn() (#3656)

* Bump futures-timer to v0.3

* Bump futures-preview to v0.3.0-alpha.18

* Replace ThreadPoll::spawn() with ThreadPoll::spawn_ok()
This commit is contained in:
Hernando Castano
2019-09-20 15:26:14 +02:00
committed by GitHub
parent c95fdd53d8
commit e434dbdfc5
21 changed files with 86 additions and 89 deletions
+2 -2
View File
@@ -21,9 +21,9 @@ substrate-telemetry = { path = "../../telemetry" }
keystore = { package = "substrate-keystore", path = "../../keystore" }
consensus_common = { package = "substrate-consensus-common", path = "../common" }
sr-primitives = { path = "../../sr-primitives" }
futures-preview = { version = "=0.3.0-alpha.17", features = ["compat"] }
futures-preview = { version = "0.3.0-alpha.18", features = ["compat"] }
futures01 = { package = "futures", version = "0.1" }
futures-timer = "0.2.1"
futures-timer = "0.3"
parking_lot = "0.9.0"
log = "0.4"
+2 -2
View File
@@ -26,9 +26,9 @@ uncles = { package = "substrate-consensus-uncles", path = "../uncles" }
slots = { package = "substrate-consensus-slots", path = "../slots" }
sr-primitives = { path = "../../sr-primitives" }
fork-tree = { path = "../../utils/fork-tree" }
futures-preview = { version = "=0.3.0-alpha.17", features = ["compat"] }
futures-preview = { version = "0.3.0-alpha.18", features = ["compat"] }
futures01 = { package = "futures", version = "0.1" }
futures-timer = "0.2.1"
futures-timer = "0.3"
parking_lot = "0.9.0"
log = "0.4.6"
schnorrkel = { version = "0.8.4", features = ["preaudit_deprecated"] }
+2 -2
View File
@@ -11,8 +11,8 @@ libp2p = { version = "0.12.0", default-features = false }
log = "0.4"
primitives = { package = "substrate-primitives", path= "../../primitives" }
inherents = { package = "substrate-inherents", path = "../../inherents" }
futures-preview = "=0.3.0-alpha.17"
futures-timer = "0.2.1"
futures-preview = "0.3.0-alpha.18"
futures-timer = "0.3"
rstd = { package = "sr-std", path = "../../sr-std" }
runtime_version = { package = "sr-version", path = "../../sr-version" }
sr-primitives = { path = "../../sr-primitives" }
@@ -15,7 +15,7 @@
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use std::{mem, pin::Pin, time::Duration};
use futures::{prelude::*, channel::mpsc, task::SpawnExt as _, task::Context, task::Poll};
use futures::{prelude::*, channel::mpsc, task::Context, task::Poll};
use futures_timer::Delay;
use sr_primitives::{Justification, traits::{Block as BlockT, Header as HeaderT, NumberFor}};
@@ -70,9 +70,7 @@ impl<B: BlockT> BasicQueue<B> {
let manual_poll;
if let Some(pool) = &mut pool {
// TODO: this expect() can be removed once
// https://github.com/rust-lang-nursery/futures-rs/pull/1750 is merged and deployed
pool.spawn(future).expect("ThreadPool can never fail to spawn tasks; QED");
pool.spawn_ok(future);
manual_poll = None;
} else {
manual_poll = Some(Box::pin(future) as Pin<Box<_>>);
+1 -1
View File
@@ -15,4 +15,4 @@ inherents = { package = "substrate-inherents", path = "../../inherents" }
pow-primitives = { package = "substrate-consensus-pow-primitives", path = "primitives" }
consensus-common = { package = "substrate-consensus-common", path = "../common" }
log = "0.4"
futures-preview = { version = "=0.3.0-alpha.17", features = ["compat"] }
futures-preview = { version = "0.3.0-alpha.18", features = ["compat"] }
+2 -2
View File
@@ -14,8 +14,8 @@ sr-primitives = { path = "../../sr-primitives" }
substrate-telemetry = { path = "../../telemetry" }
consensus_common = { package = "substrate-consensus-common", path = "../common" }
inherents = { package = "substrate-inherents", path = "../../inherents" }
futures-preview = "=0.3.0-alpha.17"
futures-timer = "0.2.1"
futures-preview = "0.3.0-alpha.18"
futures-timer = "0.3"
parking_lot = "0.9.0"
log = "0.4"