*: Bump async-std to v1.6.5 (#7306)

* *: Bump async-std to v1.6.5

Prevent users from using v1.6.4 which faces issues receiving incoming
TCP connections. See https://github.com/async-rs/async-std/issues/888
for details.

* client/network/src/gossip: Use channel instead of condvar

`async_std::sync::Condvar::wait_timeout` uses
`gloo_timers::callback::Timeout` when compiled for
`wasm32-unknown-unknown`. This timeout implementation does not fulfill
the requirement of being `Send`.

Instead of using a `Condvar` use a `futures::channel::mpsc` to signal
progress from the `QueuedSender` to the background `Future`.

* client/network/Cargo.toml: Remove async-std unstable feature

* client/network/src/gossip: Forward all queued messages

* client/network/gossip: Have QueuedSender methods take &mut self

* client/network/gossip: Move queue_size_limit into QueuedSender

The `queue_size_limit` field is only accessed by `QueuedSender`, thus
there is no need to share it between the background future and the
`QueuedSender`.

* client/network/gossip: Rename background task to future

To be a bit picky the background task is not a task in the sense of an
asynchonous task, but rather a background future in the sense of
`futures::future::Future`.
This commit is contained in:
Max Inden
2020-10-20 11:23:27 +02:00
committed by GitHub
parent bd2dbc055c
commit 918a0c8077
7 changed files with 191 additions and 146 deletions
+1 -1
View File
@@ -19,6 +19,6 @@ futures-util = { version = "0.3.1", default-features = false, features = ["io"]
derive_more = "0.99"
[target.'cfg(not(target_os = "unknown"))'.dependencies]
async-std = { version = "1.6.2", features = ["unstable"] }
async-std = { version = "1.6.5", features = ["unstable"] }
hyper = { version = "0.13.1", default-features = false, features = ["stream"] }
tokio = "0.2"