Reimplement maybe_transmit_haves with a broadcast channel
This commit is contained in:
parent
7ed7e277c0
commit
44aa75f34b
3 changed files with 35 additions and 37 deletions
|
|
@ -51,7 +51,8 @@ pub(crate) async fn read_metainfo_from_peer(
|
|||
);
|
||||
|
||||
let result_reader = async move { result_rx.await? };
|
||||
let connection_runner = async move { connection.manage_peer_outgoing(writer_rx).await };
|
||||
let (_, brx) = tokio::sync::broadcast::channel(1);
|
||||
let connection_runner = async move { connection.manage_peer_outgoing(writer_rx, brx).await };
|
||||
|
||||
tokio::select! {
|
||||
result = result_reader => result,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue