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 }
|
||||
|
||||
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-futures = { version = "0.1", features = ["tokio-alpha"], default-features = false }
|
||||
|
|
|
@ -87,21 +87,15 @@ impl TimestampCollector {
|
|||
|
||||
// Construct and then spawn a worker.
|
||||
let worker = async move {
|
||||
use futures::select;
|
||||
use futures::future::{self, Either};
|
||||
loop {
|
||||
select! {
|
||||
_ = shutdown_rx.next() => return,
|
||||
msg = worker_rx.next() => {
|
||||
match msg {
|
||||
Some(event) => {
|
||||
data2
|
||||
match future::select(shutdown_rx.next(), worker_rx.next()).await {
|
||||
Either::Left((_, _)) => return, // shutdown signal
|
||||
Either::Right((None, _)) => return, // all workers are gone
|
||||
Either::Right((Some(event), _)) => data2
|
||||
.lock()
|
||||
.expect("mutex should be unpoisoned")
|
||||
.update(event)
|
||||
}
|
||||
None => return,
|
||||
}
|
||||
}
|
||||
.update(event),
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ serde = { version = "1", features = ["serde_derive"] }
|
|||
toml = "0.5"
|
||||
|
||||
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-futures = { version = "0.1", features = ["tokio-alpha"], default-features = false }
|
||||
|
|
Loading…
Reference in New Issue