Stop using CallAllUnordered in peer_set::add_initial_peers (#1705)
* use ServiceExt::oneshot and FuturesUnordered Co-authored-by: teor <teor@riseup.net>
This commit is contained in:
parent
0723ac5be1
commit
241c7ad849
|
@ -194,9 +194,10 @@ where
|
|||
S::Future: Send + 'static,
|
||||
{
|
||||
info!(?initial_peers, "Connecting to initial peer set");
|
||||
use tower::util::CallAllUnordered;
|
||||
let addr_stream = futures::stream::iter(initial_peers.into_iter());
|
||||
let mut handshakes = CallAllUnordered::new(connector, addr_stream);
|
||||
let mut handshakes = initial_peers
|
||||
.iter()
|
||||
.map(|request| connector.clone().oneshot(*request))
|
||||
.collect::<futures::stream::FuturesUnordered<_>>();
|
||||
|
||||
while let Some(handshake_result) = handshakes.next().await {
|
||||
tx.send(handshake_result).await?;
|
||||
|
|
Loading…
Reference in New Issue