pub struct AttemptOwnerIndex { /* private fields */ }Expand description
Server-side attempt -> owning-worker back-index (§6.2).
The router resolves the CURRENT owner of a target attempt here. An entry is installed when an agent attempt is dispatched to a worker and removed when it completes / fails over, so the index reflects who owns each live attempt right now — NOT a stale registry snapshot. A miss is the attempt-scoped no-op.
Implementations§
Source§impl AttemptOwnerIndex
impl AttemptOwnerIndex
Sourcepub fn bind(&self, key: AttemptKey, worker: WorkerId)
pub fn bind(&self, key: AttemptKey, worker: WorkerId)
Record that worker currently owns the session for key.
Called when an agent attempt is dispatched. A later attempt overwrites the
prior entry for the same (workflow, activity) at a new attempt number —
each attempt is its own key, so a superseded attempt simply has no entry.
Sourcepub fn release(&self, key: &AttemptKey)
pub fn release(&self, key: &AttemptKey)
Remove the owner entry for key (the attempt finished or migrated).
Sourcepub fn owner(&self, key: &AttemptKey) -> Option<WorkerId>
pub fn owner(&self, key: &AttemptKey) -> Option<WorkerId>
The worker currently owning the session for key, if any.
Sourcepub fn attempts_for_workflow(
&self,
workflow_id: &WorkflowId,
) -> Vec<(AttemptKey, WorkerId)>
pub fn attempts_for_workflow( &self, workflow_id: &WorkflowId, ) -> Vec<(AttemptKey, WorkerId)>
Every live attempt owned for workflow_id, paired with its owning worker.
The console reads this to enumerate the attempts an operator can currently intervene on within one workflow — only attempts with a LIVE owner appear, so a finished or superseded attempt (which has no entry) is never offered. A poisoned lock yields an empty enumeration, never a panic.
Trait Implementations§
Source§impl Clone for AttemptOwnerIndex
impl Clone for AttemptOwnerIndex
Source§fn clone(&self) -> AttemptOwnerIndex
fn clone(&self) -> AttemptOwnerIndex
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 AttemptOwnerIndex
impl Debug for AttemptOwnerIndex
Source§impl Default for AttemptOwnerIndex
impl Default for AttemptOwnerIndex
Source§fn default() -> AttemptOwnerIndex
fn default() -> AttemptOwnerIndex
Auto Trait Implementations§
impl Freeze for AttemptOwnerIndex
impl RefUnwindSafe for AttemptOwnerIndex
impl Send for AttemptOwnerIndex
impl Sync for AttemptOwnerIndex
impl Unpin for AttemptOwnerIndex
impl UnsafeUnpin for AttemptOwnerIndex
impl UnwindSafe for AttemptOwnerIndex
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request