MCPcopy Create free account
hub / github.com/AI45Lab/Code / add_to_batch

Method add_to_batch

core/src/ahp/executor.rs:445–457  ·  view source on GitHub ↗

Add an event to the batch buffer. Returns true if the batch should be flushed (size threshold reached).

(&self, event: a3s_ahp::AhpEvent)

Source from the content-addressed store, hash-verified

443 ///
444 /// Returns true if the batch should be flushed (size threshold reached).
445 pub async fn add_to_batch(&self, event: a3s_ahp::AhpEvent) -> bool {
446 let should_flush = {
447 let mut buffer = write_or_recover(&self.batch_buffer);
448 buffer.push(event);
449 buffer.len() >= self.batch_size
450 };
451
452 if should_flush {
453 self.flush_batch().await;
454 }
455
456 should_flush
457 }
458
459 /// Flush the batch buffer and send all events.
460 pub async fn flush_batch(&self) {

Callers 3

publish_agent_eventMethod · 0.80
publish_run_cancelledMethod · 0.80
fireMethod · 0.80

Calls 3

write_or_recoverFunction · 0.85
flush_batchMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected