Check if batch timeout has expired and flush if needed.
(&self)
| 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) { |
nothing calls this directly
no test coverage detected