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
impl WorkflowHandle
Sourcepub fn new(parts: WorkflowHandleParts) -> Self
pub fn new(parts: WorkflowHandleParts) -> Self
Creates a workflow handle from process metadata and start-owned resources.
Sourcepub fn allocate_activity_ordinals(&self, count: u64) -> u64
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.
Sourcepub fn allocate_child_ordinals(&self, count: u64) -> u64
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.
Sourcepub fn allocate_timer_ordinals(&self, count: u64) -> u64
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.
Sourcepub fn activity_ordinals_allocated(&self) -> u64
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.
Sourcepub fn timer_ordinals_allocated(&self) -> u64
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.
Sourcepub fn child_ordinals_allocated(&self) -> u64
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.
Sourcepub fn signal_receives_consumed(&self, name: &str) -> u64
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.
Sourcepub fn mark_signal_receive_consumed(&self, name: &str)
pub fn mark_signal_receive_consumed(&self, name: &str)
Advance the completed-receive count for name by one.
Sourcepub fn signal_sends_completed(&self, name: &str) -> u64
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.
Sourcepub fn mark_signal_send_completed(&self, name: &str)
pub fn mark_signal_send_completed(&self, name: &str)
Advance the completed-send count for name by one.
Sourcepub const fn workflow_id(&self) -> &WorkflowId
pub const fn workflow_id(&self) -> &WorkflowId
Returns the logical workflow identifier.
Sourcepub fn workflow_type(&self) -> &str
pub fn workflow_type(&self) -> &str
Returns the logical workflow type / entry module selected by the caller.
Sourcepub const fn loaded_version(&self) -> &ContentHash
pub const fn loaded_version(&self) -> &ContentHash
Returns the loaded workflow package version identifier.
Sourcepub const fn cached_status(&self) -> WorkflowStatus
pub const fn cached_status(&self) -> WorkflowStatus
Returns the cached workflow status.
Sourcepub const fn residency(&self) -> Residency
pub const fn residency(&self) -> Residency
Returns the live residency tracked separately from workflow status.
Sourcepub fn recorder(&self) -> Arc<Mutex<Recorder>> ⓘ
pub fn recorder(&self) -> Arc<Mutex<Recorder>> ⓘ
Returns the shared single-writer recorder for later lifecycle transitions.
Sourcepub const fn completion(&self) -> &CompletionNotifier
pub const fn completion(&self) -> &CompletionNotifier
Returns the completion notifier created at workflow start.
Sourcepub fn next_deterministic_nif_sequence(&self) -> u64
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
impl Clone for WorkflowHandle
Source§fn clone(&self) -> WorkflowHandle
fn clone(&self) -> WorkflowHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkflowHandle
impl Debug for WorkflowHandle
impl Eq for WorkflowHandle
Auto Trait Implementations§
impl !RefUnwindSafe for WorkflowHandle
impl !UnwindSafe for WorkflowHandle
impl Freeze for WorkflowHandle
impl Send for WorkflowHandle
impl Sync for WorkflowHandle
impl Unpin for WorkflowHandle
impl UnsafeUnpin for WorkflowHandle
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.