pub enum Undeliverable {
WorkerUnreachable {
reason: String,
},
DeliveryFailed {
reason: String,
},
}Expand description
Why one delivery attempt did not place its task with a worker.
The two variants are the whole reason this is a type rather than a bool:
they carry opposite obligations for the worker’s registration, and
conflating them either destroys a live worker’s registration or keeps a dead
one’s forever.
Variants§
WorkerUnreachable
The transport reports the worker is gone — a closed gRPC stream, a liminal connection the supervisor no longer owns.
The caller deregisters it. This is the pre-existing behaviour of the closed-stream path, now reached for a reason that is true of both transports rather than inferred from a missing sender.
DeliveryFailed
The delivery failed while the worker is alive — a liminal reply that did not arrive in time, a full channel, a drain that closed the gate mid-push.
🔴 The caller keeps the registration and withdraws only its own token. Deregistering here would destroy a healthy worker because one delivery was slow, which is exactly the failure the typed outcome exists to prevent.
Implementations§
Source§impl Undeliverable
impl Undeliverable
Sourcepub fn deregisters_worker(&self) -> bool
pub fn deregisters_worker(&self) -> bool
Whether the caller should remove this worker from the registry.
true only for Undeliverable::WorkerUnreachable. Expressed as a
method so the decision has one definition rather than a match repeated
at every call site, where the two arms could drift apart.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Undeliverable
impl RefUnwindSafe for Undeliverable
impl Send for Undeliverable
impl Sync for Undeliverable
impl Unpin for Undeliverable
impl UnsafeUnpin for Undeliverable
impl UnwindSafe for Undeliverable
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> 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