pub struct ActivityStreamKey {
pub workflow_id: WorkflowId,
pub run_id: RunId,
pub activity_id: ActivityId,
pub attempt: u32,
}Expand description
The durable key of one observability stream: a (workflow, run, activity, attempt) quad. Every ActivityRecord for one running agent attempt shares
this key and is ordered by store_seq within it.
§Why the run axis exists
A continue-as-new chain reuses one WorkflowId across generations, and
BOTH of the remaining axes restart inside each new run: activity ordinals
count from 0 again and attempts from 1. A (workflow, activity, attempt)
key is therefore not unique across a chain — generation two’s first event
would be appended onto generation one’s stream head, silently fusing two
transcripts into one. The run is the axis that separates them, so it is a
required component of the key with no None arm.
Fields§
§workflow_id: WorkflowIdThe workflow the activity belongs to.
run_id: RunIdThe concrete run of that workflow — the second key axis. Two generations
of one continue-as-new chain are DISTINCT streams even when their
(activity, attempt) coordinates coincide, which they routinely do.
activity_id: ActivityIdThe activity within the workflow.
attempt: u32The attempt number — the fourth key axis (NOI-0). Two attempts of one activity are DISTINCT streams; a within-attempt failover shares one stream (so a dying + adopting worker’s events dedupe), while a retry is a new attempt and therefore a new stream.
Implementations§
Source§impl ActivityStreamKey
impl ActivityStreamKey
Sourcepub const fn new(
workflow_id: WorkflowId,
run_id: RunId,
activity_id: ActivityId,
attempt: u32,
) -> Self
pub const fn new( workflow_id: WorkflowId, run_id: RunId, activity_id: ActivityId, attempt: u32, ) -> Self
Build a stream key from its four components.
Sourcepub fn of(event: &ActivityEvent) -> Self
pub fn of(event: &ActivityEvent) -> Self
The stream key an ActivityEvent belongs to.
Trait Implementations§
Source§impl Clone for ActivityStreamKey
impl Clone for ActivityStreamKey
Source§fn clone(&self) -> ActivityStreamKey
fn clone(&self) -> ActivityStreamKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more