diff options
author | Alex Auvolat <alex@adnab.me> | 2020-04-06 22:54:03 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-04-06 22:54:03 +0200 |
commit | a09f019cc5370cedffa5adf146a3899a8fa6cd90 (patch) | |
tree | 2f8b263031798103bfd7cc2abc90c41db03d4599 /src/rpc.rs | |
parent | 87f2b4d2fc8835f8adda69adb6b51fd73ffb20a5 (diff) | |
download | garage-a09f019cc5370cedffa5adf146a3899a8fa6cd90.tar.gz garage-a09f019cc5370cedffa5adf146a3899a8fa6cd90.zip |
Seems to be fixed
Diffstat (limited to 'src/rpc.rs')
-rw-r--r-- | src/rpc.rs | 23 |
1 files changed, 1 insertions, 22 deletions
@@ -24,31 +24,10 @@ pub async fn rpc_call_many(sys: Arc<System>, timeout: Duration) -> Vec<Result<Message, Error>> { - let resp_stream = to.iter() + let mut resp_stream = to.iter() .map(|to| rpc_call(sys.clone(), to, msg, timeout)) .collect::<FuturesUnordered<_>>(); - collect_rpc_results(resp_stream, stop_after).await -} - -pub async fn rpc_call_many_addr(sys: Arc<System>, - to: &[SocketAddr], - msg: &Message, - stop_after: Option<usize>, - timeout: Duration) - -> Vec<Result<Message, Error>> -{ - let resp_stream = to.iter() - .map(|to| rpc_call_addr(sys.clone(), to, msg, timeout)) - .collect::<FuturesUnordered<_>>(); - - collect_rpc_results(resp_stream, stop_after).await -} - -async fn collect_rpc_results(mut resp_stream: FuturesUnordered<impl Future<Output=Result<Message, Error>>>, - stop_after: Option<usize>) - -> Vec<Result<Message, Error>> -{ let mut results = vec![]; let mut n_ok = 0; while let Some(resp) = resp_stream.next().await { |