#[non_exhaustive]pub enum LeaseHistoryEvent {
Acquired {
cursor: StreamCursor,
execution_id: ExecutionId,
lease_id: Option<LeaseId>,
worker_instance_id: Option<WorkerInstanceId>,
at: TimestampMs,
},
Renewed {
cursor: StreamCursor,
execution_id: ExecutionId,
lease_id: Option<LeaseId>,
worker_instance_id: Option<WorkerInstanceId>,
at: TimestampMs,
},
Expired {
cursor: StreamCursor,
execution_id: ExecutionId,
lease_id: Option<LeaseId>,
prev_owner: Option<WorkerInstanceId>,
at: TimestampMs,
},
Reclaimed {
cursor: StreamCursor,
execution_id: ExecutionId,
new_lease_id: Option<LeaseId>,
new_owner: Option<WorkerInstanceId>,
at: TimestampMs,
},
Revoked {
cursor: StreamCursor,
execution_id: ExecutionId,
lease_id: Option<LeaseId>,
revoked_by: String,
at: TimestampMs,
},
}Expand description
Per-event payload of subscribe_lease_history.
Each variant carries the fence triple fields the Lua producer
writes (lease_id, plus attempt/worker correlation where
available) and the monotonic at timestamp derived from the
backend’s native stream id / event id.
revoked_by is String today for forward compatibility; we may
promote to a typed enum post-v0.10 once the revocation-source
taxonomy settles. Known producers emit "operator",
"reconciler", or "backend" today.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Acquired
Fields
cursor: StreamCursorexecution_id: ExecutionIdlease_id: Option<LeaseId>Valkey populates this from the Lua producer; Postgres
outbox may carry None today because the attempt row
identity is (lease_epoch, attempt_index, execution_id)
rather than a stable uuid (see lease_event::emit).
worker_instance_id: Option<WorkerInstanceId>at: TimestampMsRenewed
Fields
cursor: StreamCursorexecution_id: ExecutionIdworker_instance_id: Option<WorkerInstanceId>at: TimestampMsExpired
Fields
cursor: StreamCursorexecution_id: ExecutionIdprev_owner: Option<WorkerInstanceId>at: TimestampMsReclaimed
Fields
cursor: StreamCursorexecution_id: ExecutionIdnew_owner: Option<WorkerInstanceId>at: TimestampMsRevoked
Fields
cursor: StreamCursorexecution_id: ExecutionIdrevoked_by: StringString today for forward compat; may promote to typed
enum post-v0.10 once taxonomy settles. Known values:
"operator", "reconciler", "backend".
at: TimestampMsImplementations§
Source§impl LeaseHistoryEvent
impl LeaseHistoryEvent
Sourcepub fn cursor(&self) -> &StreamCursor
pub fn cursor(&self) -> &StreamCursor
Position cursor to persist + replay from.
Sourcepub fn execution_id(&self) -> &ExecutionId
pub fn execution_id(&self) -> &ExecutionId
Execution the event pertains to.
Sourcepub fn at(&self) -> TimestampMs
pub fn at(&self) -> TimestampMs
Monotonic backend-stamped time of the event.
Trait Implementations§
Source§impl Clone for LeaseHistoryEvent
impl Clone for LeaseHistoryEvent
Source§fn clone(&self) -> LeaseHistoryEvent
fn clone(&self) -> LeaseHistoryEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more