pub struct WorkflowTaskInterceptorContext { /* private fields */ }Expand description
Read-only context of one workflow task.
Implementations§
Source§impl WorkflowTaskInterceptorContext
impl WorkflowTaskInterceptorContext
pub fn worker_id(&self) -> &str
pub fn task_queue(&self) -> &str
pub fn namespace(&self) -> &str
pub fn task_id(&self) -> &str
pub fn workflow_id(&self) -> Option<&str>
pub fn run_id(&self) -> Option<&str>
pub fn workflow_type(&self) -> &str
Sourcepub fn attempt(&self) -> u64
pub fn attempt(&self) -> u64
The workflow-task attempt; above 1 when the Server retries the task.
Sourcepub fn history_event_count(&self) -> usize
pub fn history_event_count(&self) -> usize
Number of history events delivered with the task.
Sourcepub fn total_history_events(&self) -> Option<u64>
pub fn total_history_events(&self) -> Option<u64>
The Server’s committed history length, when it reported one.
Sourcepub fn history_size_bytes(&self) -> Option<u64>
pub fn history_size_bytes(&self) -> Option<u64>
The Server’s committed history size, when it reported one.
pub fn cancel_requested(&self) -> bool
Sourcepub fn observability_context(&self) -> Option<&Value>
pub fn observability_context(&self) -> Option<&Value>
The task’s optional, untrusted observability metadata (trace carrier).
Sourcepub fn replay_state(&self) -> WorkflowReplayState
pub fn replay_state(&self) -> WorkflowReplayState
Whether this task re-runs a committed history prefix before new execution.
WorkflowReplayState::Replaying: the history holds commands that
earlier workflow tasks committed, so workflow code re-runs them before
any new execution. WorkflowReplayState::Executing: no committed
prefix. WorkflowReplayState::Unavailable: the history could not be
read (the core reports why).
Replayed commands are never resubmitted, so the outcome’s commands are
new for this task in every state. Do not skip auditing a task because it
replayed. A retry of a failed task (attempt() > 1) can repeat an
outcome.
Trait Implementations§
Source§impl Clone for WorkflowTaskInterceptorContext
impl Clone for WorkflowTaskInterceptorContext
Source§fn clone(&self) -> WorkflowTaskInterceptorContext
fn clone(&self) -> WorkflowTaskInterceptorContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more