pub struct SubtaskRegistry { /* private fields */ }Expand description
Registry of active subtask handles for a session.
This is used by the gateway to track all running subtasks and allow the agent to list, join, or cancel them.
Implementations§
Source§impl SubtaskRegistry
impl SubtaskRegistry
Sourcepub fn register<T: Send + 'static>(
&mut self,
handle: &SubtaskHandle<T>,
label: impl Into<String>,
)
pub fn register<T: Send + 'static>( &mut self, handle: &SubtaskHandle<T>, label: impl Into<String>, )
Register a subtask. Call this after spawning.
Sourcepub fn cancel(&mut self, thread_id: &ThreadId) -> bool
pub fn cancel(&mut self, thread_id: &ThreadId) -> bool
Cancel a subtask by thread ID (cooperative via CancellationToken).
Sourcepub fn cancel_all(&mut self)
pub fn cancel_all(&mut self)
Cancel all subtasks (cooperative via CancellationToken).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SubtaskRegistry
impl RefUnwindSafe for SubtaskRegistry
impl Send for SubtaskRegistry
impl Sync for SubtaskRegistry
impl Unpin for SubtaskRegistry
impl UnsafeUnpin for SubtaskRegistry
impl UnwindSafe for SubtaskRegistry
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