Skip to main content

WorkflowHandle

Struct WorkflowHandle 

Source
pub struct WorkflowHandle { /* private fields */ }
Expand description

Live workflow process metadata cached in the active-execution registry.

The handle stores only the runtime process identifier value, not a runtime object or scheduler state. The cached status is reconciled from the durable event projection by the registry. Residency is engine-internal and separate from projected workflow status.

Implementations§

Source§

impl WorkflowHandle

Source

pub fn new(parts: WorkflowHandleParts) -> Self

Creates a workflow handle from process metadata and start-owned resources.

Source

pub fn allocate_activity_ordinals(&self, count: u64) -> u64

Allocate count consecutive activity correlation ordinals.

The sequence is monotonic per run and shared by every NIF call the run makes (handles clone the same counter), so distinct workflow steps never collide on correlation keys. A re-spawned run (crash recovery, continue-as-new) gets a fresh handle and counter, and its replayed code re-allocates the same ordinals deterministically.

Source

pub fn allocate_child_ordinals(&self, count: u64) -> u64

Allocate count consecutive child-workflow spawn ordinals.

Same determinism contract as Self::allocate_activity_ordinals: monotonic per run, shared by every NIF call the run makes, and re-allocated identically by replayed code on a re-spawned run. The n-th allocated ordinal correlates the n-th spawn_child call with the n-th recorded ChildWorkflowStarted in the run’s history segment, independent of event sequence numbers and of any asynchronous-arrival events interleaved between spawns.

Source

pub fn allocate_timer_ordinals(&self, count: u64) -> u64

Allocate count consecutive timer ordinals.

Same determinism contract as Self::allocate_activity_ordinals: monotonic per run, shared by every NIF call the run makes, and re-allocated identically by replayed code on a re-spawned run. Used to derive anonymous timer identities (sleep, with_timeout scope deadlines) that stay stable across crash-recovery replay.

Source

pub fn activity_ordinals_allocated(&self) -> u64

Activity ordinals allocated so far by this run’s execution.

Read-only progress probe: replay re-allocates deterministically, so a value below the run segment’s recorded ActivityScheduled count means the run is still mid-replay.

Source

pub fn timer_ordinals_allocated(&self) -> u64

Timer ordinals allocated so far by this run’s execution.

Same replay-progress contract as Self::activity_ordinals_allocated, measured against recorded anonymous TimerStarted events.

Source

pub fn child_ordinals_allocated(&self) -> u64

Child-workflow ordinals allocated so far by this run’s execution.

Same replay-progress contract as Self::activity_ordinals_allocated, measured against recorded ChildWorkflowStarted events.

Source

pub fn signal_receives_consumed(&self, name: &str) -> u64

Number of receive_signal(name) calls this run has completed.

Drives the run-scoped consumption index for signal awaits: the k-th completed receive for a name consumes the k-th recorded SignalReceived for that name in this run’s segment. Replayed code re-executes the same receives in order and re-derives the same indices; a timed-out receive consumes nothing and does not advance.

Source

pub fn mark_signal_receive_consumed(&self, name: &str)

Advance the completed-receive count for name by one.

Source

pub fn signal_sends_completed(&self, name: &str) -> u64

Number of send_signal(name) calls this run has completed.

Drives the run-scoped correlation index for sends: the k-th completed send for a name correlates with the k-th recorded SignalSent for that name in this run’s segment. Replayed code re-executes the same sends in order and re-derives the same indices, independent of any same-name arrivals recorded around them.

Source

pub fn mark_signal_send_completed(&self, name: &str)

Advance the completed-send count for name by one.

Source

pub const fn workflow_id(&self) -> &WorkflowId

Returns the logical workflow identifier.

Source

pub const fn run_id(&self) -> &RunId

Returns the concrete run identifier.

Source

pub const fn pid(&self) -> u64

Returns the embedded runtime process identifier value.

Source

pub fn workflow_type(&self) -> &str

Returns the logical workflow type / entry module selected by the caller.

Source

pub fn namespace(&self) -> &str

Returns the namespace that owns this workflow execution.

Source

pub const fn loaded_version(&self) -> &ContentHash

Returns the loaded workflow package version identifier.

Source

pub const fn cached_status(&self) -> WorkflowStatus

Returns the cached workflow status.

Source

pub const fn residency(&self) -> Residency

Returns the live residency tracked separately from workflow status.

Source

pub fn recorder(&self) -> Arc<Mutex<Recorder>>

Returns the shared single-writer recorder for later lifecycle transitions.

Source

pub const fn completion(&self) -> &CompletionNotifier

Returns the completion notifier created at workflow start.

Source

pub fn next_deterministic_nif_sequence(&self) -> u64

Returns and advances the workflow-local deterministic NIF call sequence.

Trait Implementations§

Source§

impl Clone for WorkflowHandle

Source§

fn clone(&self) -> WorkflowHandle

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 WorkflowHandle

Source§

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

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

impl Eq for WorkflowHandle

Source§

impl PartialEq for WorkflowHandle

Source§

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

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

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

Inequality operator !=. Read more

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<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<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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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