From 7bf77c574ba9316d647aad5877f91db45b142c43 Mon Sep 17 00:00:00 2001 From: Carlos V <131038589+carlosvdr@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:49:24 -0600 Subject: [PATCH] fix: change buffered to buffered_unordened for faster collecting (#457) --- tap-agent/src/agent/sender_account.rs | 2 +- tap-agent/src/agent/sender_accounts_manager.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tap-agent/src/agent/sender_account.rs b/tap-agent/src/agent/sender_account.rs index de1fb91e..675aae38 100644 --- a/tap-agent/src/agent/sender_account.rs +++ b/tap-agent/src/agent/sender_account.rs @@ -656,7 +656,7 @@ impl Actor for SenderAccount { stream::iter(allocation_ids) // Create a sender allocation for each allocation .map(|allocation_id| state.create_sender_allocation(myself.clone(), allocation_id)) - .buffered(10) // Limit concurrency to 10 allocations at a time + .buffer_unordered(10) // Limit concurrency to 10 allocations at a time .collect::>>() .await .into_iter() diff --git a/tap-agent/src/agent/sender_accounts_manager.rs b/tap-agent/src/agent/sender_accounts_manager.rs index 69ee233d..af6c38e2 100644 --- a/tap-agent/src/agent/sender_accounts_manager.rs +++ b/tap-agent/src/agent/sender_accounts_manager.rs @@ -169,7 +169,7 @@ impl Actor for SenderAccountsManager { .map(|(sender_id, allocation_ids)| { state.create_or_deny_sender(myself.get_cell(), sender_id, allocation_ids) }) - .buffered(10) // Limit concurrency to 10 senders at a time + .buffer_unordered(10) // Limit concurrency to 10 senders at a time .collect::>() .await;