pub struct CompletionFences { /* private fields */ }Expand description
Process-incarnation registry of the only generations allowed to complete.
Recovery deliberately starts with an empty registry. Re-dispatch issues a fresh token, so a result carrying any pre-recovery token is refused whether it arrives before or after the new dispatch.
Implementations§
Source§impl CompletionFences
impl CompletionFences
Sourcepub fn issue(
&self,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
) -> Result<CompletionToken, ServerError>
pub fn issue( &self, workflow_id: &WorkflowId, activity_id: &ActivityId, ) -> Result<CompletionToken, ServerError>
Supersede any prior generation and return the newly authorized token.
§Errors
Returns ServerError::LockPoisoned when fence state cannot be trusted.
Sourcepub fn accept(
&self,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
submitted: &CompletionToken,
) -> Result<(), ServerError>
pub fn accept( &self, workflow_id: &WorkflowId, activity_id: &ActivityId, submitted: &CompletionToken, ) -> Result<(), ServerError>
Consume the current generation only when submitted exactly matches it.
Consumption and comparison share one mutex critical section, making two concurrent submissions unable to both become truth.
§Errors
Returns a typed rejection for a missing/current-generation mismatch, or
ServerError::LockPoisoned when fence state cannot be trusted.
Sourcepub fn revoke(
&self,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
token: &CompletionToken,
) -> Result<(), ServerError>
pub fn revoke( &self, workflow_id: &WorkflowId, activity_id: &ActivityId, token: &CompletionToken, ) -> Result<(), ServerError>
Revoke token if it is still current, without disturbing a newer retry.
§Errors
Returns ServerError::LockPoisoned when fence state cannot be trusted.
Sourcepub fn revoke_current(
&self,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
) -> Result<(), ServerError>
pub fn revoke_current( &self, workflow_id: &WorkflowId, activity_id: &ActivityId, ) -> Result<(), ServerError>
Revoke whichever generation is current while parking for recovery.
§Errors
Returns ServerError::LockPoisoned when fence state cannot be trusted.
Trait Implementations§
Source§impl Clone for CompletionFences
impl Clone for CompletionFences
Source§fn clone(&self) -> CompletionFences
fn clone(&self) -> CompletionFences
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 CompletionFences
impl Debug for CompletionFences
Source§impl Default for CompletionFences
impl Default for CompletionFences
Source§fn default() -> CompletionFences
fn default() -> CompletionFences
Auto Trait Implementations§
impl Freeze for CompletionFences
impl RefUnwindSafe for CompletionFences
impl Send for CompletionFences
impl Sync for CompletionFences
impl Unpin for CompletionFences
impl UnsafeUnpin for CompletionFences
impl UnwindSafe for CompletionFences
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> 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