aboutsummaryrefslogtreecommitdiff
path: root/src/rpc.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-06 22:54:03 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-06 22:54:03 +0200
commita09f019cc5370cedffa5adf146a3899a8fa6cd90 (patch)
tree2f8b263031798103bfd7cc2abc90c41db03d4599 /src/rpc.rs
parent87f2b4d2fc8835f8adda69adb6b51fd73ffb20a5 (diff)
downloadgarage-a09f019cc5370cedffa5adf146a3899a8fa6cd90.tar.gz
garage-a09f019cc5370cedffa5adf146a3899a8fa6cd90.zip
Seems to be fixed
Diffstat (limited to 'src/rpc.rs')
-rw-r--r--src/rpc.rs23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/rpc.rs b/src/rpc.rs
index d8bb08a8..5f25dafb 100644
--- a/src/rpc.rs
+++ b/src/rpc.rs
@@ -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 {