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

Method check_batch_timeout

core/src/ahp/executor.rs:488–501  ·  view source on GitHub ↗

Check if batch timeout has expired and flush if needed.

(&self)

Source from the content-addressed store, hash-verified

486
487 /// Check if batch timeout has expired and flush if needed.
488 pub async fn check_batch_timeout(&self) {
489 let elapsed = {
490 let last = self.last_batch_flush.load(Ordering::Relaxed);
491 let now = std::time::SystemTime::now()
492 .duration_since(std::time::UNIX_EPOCH)
493 .unwrap()
494 .as_millis() as u64;
495 now.saturating_sub(last)
496 };
497
498 if elapsed >= self.batch_timeout_ms {
499 self.flush_batch().await;
500 }
501 }
502
503 /// Publish durable AHP contract events derived from runtime AgentEvents.
504 pub async fn publish_agent_event(&self, event: &AgentEvent, run_id: &str, session_id: &str) {

Callers

nothing calls this directly

Calls 3

nowFunction · 0.85
flush_batchMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected