(&self, agent_run_id: &str, allowed: bool)
| 34 | } |
| 35 | |
| 36 | pub fn respond(&self, agent_run_id: &str, allowed: bool) -> bool { |
| 37 | self.pending |
| 38 | .lock() |
| 39 | .ok() |
| 40 | .and_then(|mut pending| pending.remove(agent_run_id)) |
| 41 | .map(|tx| tx.send(allowed).is_ok()) |
| 42 | .unwrap_or(false) |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | /// Registry for cancellation tokens keyed by an arbitrary ID (session_id or agent_run_id). |
no test coverage detected