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 max_concurrency(&self) -> Option<NonZeroU32>
pub const fn max_concurrency(&self) -> Option<NonZeroU32>
How many activities this worker runs AT ONCE, as it advertised, or
None while it has registered but not yet said.
A dispatch PRECONDITION, read by [eligible_candidates_in_rotation]:
a worker holding this many in-flight activities is passed over rather
than pushed past its own admission. Pushing past it is what produced a
worker that stopped reading its stream, answered no pings, and was then
deregistered as lost while it was in fact working.
None is reachable only on the liminal transport, whose published
registration frame has no capacity field, and only for the one round
trip between that registration and the worker’s capacity announcement.
It means UNKNOWN, never unlimited: selection treats an unknown capacity
as full, because the alternative is to invent a number for a process
that is about to state its own.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Whether the server still holds an OPEN push channel to this worker.
The explicit connected fact, as opposed to the absence of noise. Silence alone cannot tell a worker that is gone from one that is busy, and the expiry sweep used to read the second as the first; this is the third input that separates them.
gRPC answers from the stream sender itself — a closed receiver means the tonic task that owned the stream is gone. Liminal answers from its connection: the transport holds a live push connection or it does not.
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