pub struct WorkerHandle { /* private fields */ }Expand description
Cloneable handle for a registered worker stream.
A worker serves a SET of namespaces under a single task_queue, so it is
indexed under one (namespace, task_queue, activity_type) key per namespace
in its set. node is an OPTIONAL locality affinity (a locality, not a
process — many handles may share a node id) used as a within-pool filter at
selection time; None means the worker advertised no locality.
Implementations§
Source§impl WorkerHandle
impl WorkerHandle
Sourcepub const fn namespaces(&self) -> &BTreeSet<String>
pub const fn namespaces(&self) -> &BTreeSet<String>
Namespaces authorized for this worker stream. The worker is reachable for a dispatch only when its set includes the workflow’s namespace.
Sourcepub fn identity(&self) -> &str
pub fn identity(&self) -> &str
The identity string this worker registered under, exactly as the registration frame carried it (empty when the worker sent none).
Sourcepub fn task_queue(&self) -> &str
pub fn task_queue(&self) -> &str
Task queue (pool/flavour) this worker serves within each namespace.
Sourcepub fn node(&self) -> Option<&str>
pub fn node(&self) -> Option<&str>
Optional locality affinity this worker advertised. None means the
worker carries no node and is reachable only for unpinned dispatches.
Sourcepub fn activity_types(&self) -> &BTreeSet<String>
pub fn activity_types(&self) -> &BTreeSet<String>
Activity types advertised by this worker.
Sourcepub const fn instance(&self) -> Option<&WorkerInstanceIdentity>
pub const fn instance(&self) -> Option<&WorkerInstanceIdentity>
Optional durable deployment/instance association supplied at registration.
Sourcepub const fn delivery(&self) -> &WorkerDelivery
pub const fn delivery(&self) -> &WorkerDelivery
The transport this worker is delivered to through.
Sourcepub const fn intervention_capabilities(&self) -> &InterventionCapabilities
pub const fn intervention_capabilities(&self) -> &InterventionCapabilities
The neutral intervention primitives this worker’s harness advertises (NOI-6).
The intervention router gates on this set and never routes an unadvertised primitive. Empty (the default for a plain activity worker) means the worker is observability-only: the router refuses every intervention command for it.
Sourcepub fn sender(&self) -> Option<&WorkerTaskSender>
pub fn sender(&self) -> Option<&WorkerTaskSender>
gRPC stream sender used by the gRPC dispatch path to push work, or None
when this worker is delivered to over a non-gRPC transport (liminal).
The gRPC dispatch path registers every worker with a WorkerDelivery::Grpc
delivery, so this is always Some for a gRPC-registered worker — the
behaviour the path relied on before delivery became transport-agnostic.
Trait Implementations§
Source§impl Clone for WorkerHandle
impl Clone for WorkerHandle
Source§fn clone(&self) -> WorkerHandle
fn clone(&self) -> WorkerHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WorkerHandle
impl !UnwindSafe for WorkerHandle
impl Freeze for WorkerHandle
impl Send for WorkerHandle
impl Sync for WorkerHandle
impl Unpin for WorkerHandle
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request