[companion] Fix request-response protocols backpressure mechanism (#7276)

* Replace request-response incoming requests queue with `async-channel`

* Fix unused imports

* Fix channel type in tests

* Fix channel type in tests (part 2)

* Fix unused imports

* update lockfile for {"substrate"}

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Dmitry Markin
2023-05-24 13:34:06 +03:00
committed by GitHub
parent d219260cac
commit 86564f1d66
7 changed files with 352 additions and 344 deletions
@@ -16,10 +16,7 @@
use std::marker::PhantomData;
use futures::{
channel::{mpsc, oneshot},
StreamExt,
};
use futures::{channel::oneshot, StreamExt};
use parity_scale_codec::{Decode, Encode};
@@ -208,7 +205,7 @@ pub struct OutgoingResponse<Response> {
///
/// Takes care of decoding and handling of invalid encoded requests.
pub struct IncomingRequestReceiver<Req> {
raw: mpsc::Receiver<netconfig::IncomingRequest>,
raw: async_channel::Receiver<netconfig::IncomingRequest>,
phantom: PhantomData<Req>,
}