Step¶
Operation module: async_durable_execution._operation.step.
Use step() to checkpoint nondeterministic work and side effects. Completed
steps return their saved result during replay instead of running again.
User-facing durable step operation.
Classes¶
StepInterruptedError
¶
StepSemantics
¶
Bases: Enum
Checkpoint timing guarantees for a durable step attempt.
StepContext
dataclass
¶
StepContext(
execution_state: ExecutionState,
operation_identifier: OperationIdentifier,
attempt: int | None = None,
)
Bases: OperationContext
Context exposed while a step function is executing.
Functions:¶
step
¶
step(
func: Callable[[], Awaitable[T]],
*,
name: str | None = None,
retry_strategy: Callable[
[Exception, int], Duration | None
]
| None = None,
step_semantics: StepSemantics = AT_LEAST_ONCE_PER_RETRY,
serdes: SerDes | None = None,
) -> Task[T]
Run user code as a checkpointed durable step.
Durable steps are the main way to isolate non-deterministic work such as API calls, clock reads, UUID generation, and database access from replayed code.