Skip to main content

WorkerSessionEvent

Enum WorkerSessionEvent 

Source
pub enum WorkerSessionEvent {
    Task(Box<ProtoActivityTask>),
    Drain,
    ResultAck {
        workflow_id: WorkflowId,
        activity_id: ActivityId,
    },
    Cancel {
        workflow_id: WorkflowId,
        activity_id: ActivityId,
    },
    LivenessPing {
        sequence: u64,
        silence_window: Duration,
    },
}
Expand description

Event pushed by the worker session receive stream.

Variants§

§

Task(Box<ProtoActivityTask>)

A new activity task to execute.

§

Drain

Server-initiated drain: the server is going away (restart, deploy, rebalance). The worker finishes in-flight work, reports what it can, stops expecting new tasks, and reconnects after the schedule’s initial backoff. A drain frame latches for the session: the eventual stream end — clean or abrupt — is drain-class and consumes no drop budget.

§

ResultAck

The server consumed the identified ActivityResult frame; the worker may stop re-reporting it. Clears the matching unacked-tracker entry.

Fields

§workflow_id: WorkflowId

Workflow owning the acknowledged result.

§activity_id: ActivityId

Activity whose result was acknowledged.

§

Cancel

Cooperative cancellation for an in-flight activity.

Carried on the wire as CancelActivity and decoded by decode_cancel_activity. The runtime handles it without forcing task termination: the activity’s cancellation token is tripped and the handler is given the chance to stop on its own terms.

Fields

§workflow_id: WorkflowId

Workflow owning the activity.

§activity_id: ActivityId

Activity to mark cancelled.

§

LivenessPing

Transport liveness ping from the server (#197): answer it, promptly, or this worker is not selected for dispatch.

The RUNTIME answers it — never action code. The server is measuring whether it can reach this worker’s DISPATCH path, and an answer produced by a handler would measure whether a handler happens to be running.

Fields

§sequence: u64

Sequence to echo back verbatim. An answer carrying anything else is discarded by the server as a stale or fabricated echo.

§silence_window: Duration

How long this worker may hear NOTHING on this stream before it should treat the link as dead — the server’s own configured window, carried on every ping so the worker holds no second copy of it.

Trait Implementations§

Source§

impl Clone for WorkerSessionEvent

Source§

fn clone(&self) -> WorkerSessionEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WorkerSessionEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for WorkerSessionEvent

Source§

impl PartialEq for WorkerSessionEvent

Source§

fn eq(&self, other: &WorkerSessionEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WorkerSessionEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more