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

Method register_canceller

core/src/subagent_task_tracker.rs:113–118  ·  view source on GitHub ↗

Register a `CancellationToken` for a running task so callers can trigger cancellation through `cancel(task_id)`. The task executor is expected to remove the entry on exit via `clear_canceller`.

(&self, task_id: &str, token: CancellationToken)

Source from the content-addressed store, hash-verified

111 /// trigger cancellation through `cancel(task_id)`. The task executor
112 /// is expected to remove the entry on exit via `clear_canceller`.
113 pub async fn register_canceller(&self, task_id: &str, token: CancellationToken) {
114 self.cancellers
115 .write()
116 .await
117 .insert(task_id.to_string(), token);
118 }
119
120 pub async fn clear_canceller(&self, task_id: &str) {
121 self.cancellers.write().await.remove(task_id);

Calls 2

writeMethod · 0.80
insertMethod · 0.45