Remove async-await feature of futures.
This commit is contained in:
parent
373a8fbcfd
commit
fc872ea03f
|
@ -21,7 +21,7 @@ pin-project = "0.4"
|
||||||
indexmap = { version = "1.2", default-features = false }
|
indexmap = { version = "1.2", default-features = false }
|
||||||
|
|
||||||
tokio = "=0.2.0-alpha.6"
|
tokio = "=0.2.0-alpha.6"
|
||||||
futures-preview = { version = "=0.3.0-alpha.19", features = ["async-await"] }
|
futures-preview = "=0.3.0-alpha.19"
|
||||||
|
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-futures = { version = "0.1", features = ["tokio-alpha"], default-features = false }
|
tracing-futures = { version = "0.1", features = ["tokio-alpha"], default-features = false }
|
||||||
|
|
|
@ -87,21 +87,15 @@ impl TimestampCollector {
|
||||||
|
|
||||||
// Construct and then spawn a worker.
|
// Construct and then spawn a worker.
|
||||||
let worker = async move {
|
let worker = async move {
|
||||||
use futures::select;
|
use futures::future::{self, Either};
|
||||||
loop {
|
loop {
|
||||||
select! {
|
match future::select(shutdown_rx.next(), worker_rx.next()).await {
|
||||||
_ = shutdown_rx.next() => return,
|
Either::Left((_, _)) => return, // shutdown signal
|
||||||
msg = worker_rx.next() => {
|
Either::Right((None, _)) => return, // all workers are gone
|
||||||
match msg {
|
Either::Right((Some(event), _)) => data2
|
||||||
Some(event) => {
|
|
||||||
data2
|
|
||||||
.lock()
|
.lock()
|
||||||
.expect("mutex should be unpoisoned")
|
.expect("mutex should be unpoisoned")
|
||||||
.update(event)
|
.update(event),
|
||||||
}
|
|
||||||
None => return,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,7 +15,7 @@ serde = { version = "1", features = ["serde_derive"] }
|
||||||
toml = "0.5"
|
toml = "0.5"
|
||||||
|
|
||||||
tokio = "=0.2.0-alpha.6"
|
tokio = "=0.2.0-alpha.6"
|
||||||
futures-preview = { version = "=0.3.0-alpha.19", features = ["async-await"] }
|
futures-preview = "=0.3.0-alpha.19"
|
||||||
|
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-futures = { version = "0.1", features = ["tokio-alpha"], default-features = false }
|
tracing-futures = { version = "0.1", features = ["tokio-alpha"], default-features = false }
|
||||||
|
|
Loading…
Reference in New Issue