perf: batched event reception

This commit is contained in:
link2xt
2026-02-04 14:46:07 +00:00
committed by l
parent cdb0e0ce29
commit bbf9a86bce
4 changed files with 62 additions and 18 deletions

View File

@@ -194,6 +194,16 @@ impl CommandApi {
.context("event channel is closed")
}
/// Waits for at least one event and return a batch of events.
async fn get_next_event_batch(&self) -> Vec<Event> {
self.event_emitter
.recv_batch()
.await
.into_iter()
.map(|event| event.into())
.collect()
}
// ---------------------------------------------
// Account Management
// ---------------------------------------------