pub struct WorkerJoinHandler {
pub worker_id: WorkerId,
pub cancel: CancellationToken,
pub completion: Receiver<Result<(), WorkerError>>,
}Expand description
Handler for a Worker’s async completion signal. A building
block; it does not implement Worker itself. Holds the
(worker_id, cancel token, oneshot receiver) triple and is embedded
by every per-kind Worker (AgentBlockWorker / LuaWorker /
RustFnWorker / ProcessWorker / OperatorWorker).
“The Worker that actually does the work” and “the mechanism that
waits for its async completion” are two different concepts. This
struct is dedicated to the latter; the former is expressed by
per-kind Worker structs — one type per AgentKind, each hiding its
kind-specific state (SDK quirks, VM state, child-process handles,
etc.) inside itself.
Fields§
§worker_id: WorkerIdIdentity of the worker this handler belongs to.
cancel: CancellationTokenCancellation token shared with the running task; cloned out via
Worker::cancel_token.
completion: Receiver<Result<(), WorkerError>>Receiver side of the oneshot channel the spawned task completes
through. Consumed by await_completion.
Implementations§
Source§impl WorkerJoinHandler
impl WorkerJoinHandler
Sourcepub async fn await_completion(self) -> Result<(), WorkerError>
pub async fn await_completion(self) -> Result<(), WorkerError>
Shared helper that receives the join async signal. This is the
canonical path called from every per-kind Worker’s Worker::join
implementation.
Trait Implementations§
Source§impl From<WorkerJoinHandler> for LuaWorker
impl From<WorkerJoinHandler> for LuaWorker
Source§fn from(handler: WorkerJoinHandler) -> Self
fn from(handler: WorkerJoinHandler) -> Self
Source§impl From<WorkerJoinHandler> for RustFnWorker
impl From<WorkerJoinHandler> for RustFnWorker
Source§fn from(handler: WorkerJoinHandler) -> Self
fn from(handler: WorkerJoinHandler) -> Self
Source§impl From<WorkerJoinHandler> for AgentBlockWorker
impl From<WorkerJoinHandler> for AgentBlockWorker
Source§fn from(handler: WorkerJoinHandler) -> Self
fn from(handler: WorkerJoinHandler) -> Self
Source§impl From<WorkerJoinHandler> for MiddlewareWorker
impl From<WorkerJoinHandler> for MiddlewareWorker
Source§fn from(handler: WorkerJoinHandler) -> Self
fn from(handler: WorkerJoinHandler) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for WorkerJoinHandler
impl !UnwindSafe for WorkerJoinHandler
impl Freeze for WorkerJoinHandler
impl Send for WorkerJoinHandler
impl Sync for WorkerJoinHandler
impl Unpin for WorkerJoinHandler
impl UnsafeUnpin for WorkerJoinHandler
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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