pub struct WorkerHandle {
pub tx: UnboundedSender<String>,
pub task_id: TaskId,
}Expand description
A long-lived handle to a background worker, enabling cross-turn
continuation via send_message.
When a worker is spawned in the background, its AgentRuntime lives in a
dedicated tokio task that drains an mpsc channel of incoming prompts. Each
send_message to this worker pushes a prompt onto tx; the worker task
runs it as a new turn on the same runtime (preserving transcript/context).
task_id links this handle to the TaskRegistry entry so task_get /
task_output / task_stop work uniformly.
Fields§
§tx: UnboundedSender<String>Push a new turn prompt to the background worker. Returns Err if the worker task has exited (channel closed).
task_id: TaskIdThe TaskRegistry id under which this worker is registered.
Auto Trait Implementations§
impl Freeze for WorkerHandle
impl RefUnwindSafe for WorkerHandle
impl Send for WorkerHandle
impl Sync for WorkerHandle
impl Unpin for WorkerHandle
impl UnsafeUnpin for WorkerHandle
impl UnwindSafe for WorkerHandle
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.