pub struct InMemorySubagentTaskTracker { /* private fields */ }Implementations§
Source§impl InMemorySubagentTaskTracker
impl InMemorySubagentTaskTracker
pub fn new() -> Self
Sourcepub async fn register_canceller(&self, task_id: &str, token: CancellationToken)
pub async fn register_canceller(&self, task_id: &str, token: CancellationToken)
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.
pub async fn clear_canceller(&self, task_id: &str)
Sourcepub async fn cancel(&self, task_id: &str) -> bool
pub async fn cancel(&self, task_id: &str) -> bool
Fire the registered token and mark the snapshot as Cancelled.
Returns true if a token was found (caller can interpret as
“cancellation initiated”), false if the task id was unknown or
the task already finished. The eventual SubagentEnd event won’t
overwrite the Cancelled status — see record_event.
Sourcepub async fn record_event(&self, event: &AgentEvent)
pub async fn record_event(&self, event: &AgentEvent)
Apply a single agent event to the tracker. Non-subagent events are ignored.
pub async fn get(&self, task_id: &str) -> Option<SubagentTaskSnapshot>
pub async fn list(&self) -> Vec<SubagentTaskSnapshot>
pub async fn list_pending(&self) -> Vec<SubagentTaskSnapshot>
pub async fn list_for_parent( &self, parent_session_id: &str, ) -> Vec<SubagentTaskSnapshot>
Trait Implementations§
Source§impl Debug for InMemorySubagentTaskTracker
impl Debug for InMemorySubagentTaskTracker
Source§impl Default for InMemorySubagentTaskTracker
impl Default for InMemorySubagentTaskTracker
Source§fn default() -> InMemorySubagentTaskTracker
fn default() -> InMemorySubagentTaskTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for InMemorySubagentTaskTracker
impl !RefUnwindSafe for InMemorySubagentTaskTracker
impl Send for InMemorySubagentTaskTracker
impl Sync for InMemorySubagentTaskTracker
impl Unpin for InMemorySubagentTaskTracker
impl UnsafeUnpin for InMemorySubagentTaskTracker
impl !UnwindSafe for InMemorySubagentTaskTracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more