#[non_exhaustive]pub enum StepSemantics {
AtLeastOncePerRetry,
AtMostOncePerRetry,
}Expand description
Execution semantics for a step, controlling behavior on interrupted replay.
When a step is interrupted mid-execution (e.g., a Lambda timeout or crash),
the checkpoint log records a Started status without an outcome. On the
next invocation, the SDK must decide whether to re-execute the step body.
This is a client-side only configuration: it is not sent on the wire.
The checkpoint Start action is identical regardless of semantics; the
difference is purely in the replay decision when Started status is
encountered.
§Examples
use aws_durable_execution_sdk::StepSemantics;
// Default: re-execute on replay if interrupted.
let default = StepSemantics::AtLeastOncePerRetry;
// Idempotency-sensitive: treat interrupted as failed, consult retry strategy.
let at_most_once = StepSemantics::AtMostOncePerRetry;Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AtLeastOncePerRetry
Re-execute the step body on replay if the previous attempt was
interrupted (status Started with no outcome).
This is the default behavior and matches the semantics of most
idempotent operations. The step may execute more than once per retry
attempt if the process is interrupted between Start checkpoint and
the outcome checkpoint.
The body starts without waiting for the START checkpoint. The
outcome is written only after START is acknowledged; if START
fails, the outcome is not written and the invocation fails.
AtMostOncePerRetry
Do not re-execute the step body if the previous attempt was interrupted. Instead, treat the interruption as a failure and consult the retry strategy to decide whether to schedule a new attempt or fail permanently.
The retry strategy sees StepErrorKind::Interrupted, and the
RETRY or FAIL record carries the error type StepInterruptedError.
When the strategy stops, the step returns that kind, live and on
replay.
Use this for non-idempotent operations (e.g., charging a credit card) where re-execution could produce duplicate side effects.
Trait Implementations§
Source§impl Clone for StepSemantics
impl Clone for StepSemantics
impl Copy for StepSemantics
Source§impl Debug for StepSemantics
impl Debug for StepSemantics
Source§impl Default for StepSemantics
impl Default for StepSemantics
impl Eq for StepSemantics
Source§impl PartialEq for StepSemantics
impl PartialEq for StepSemantics
impl StructuralPartialEq for StepSemantics
Auto Trait Implementations§
impl Forget for StepSemantics
impl Freeze for StepSemantics
impl Move for StepSemantics
impl RefUnwindSafe for StepSemantics
impl Send for StepSemantics
impl Sync for StepSemantics
impl Unpin for StepSemantics
impl UnsafeUnpin for StepSemantics
impl UnwindSafe for StepSemantics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more