Skip to content

Commit

Permalink
fix: change buffered to buffered_unordened for faster collecting (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosvdr authored Nov 4, 2024
1 parent 3ae39c0 commit 7bf77c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tap-agent/src/agent/sender_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<anyhow::Result<()>>>()
.await
.into_iter()
Expand Down
2 changes: 1 addition & 1 deletion tap-agent/src/agent/sender_accounts_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<()>>()
.await;

Expand Down

0 comments on commit 7bf77c5

Please sign in to comment.