Expand description
Execution state management for the AWS Durable Execution SDK.
This module provides the core state management types for durable executions, including checkpoint tracking, replay logic, and operation state management.
§Module Structure
checkpoint_result- Result types for checkpoint queriesreplay_status- Replay state trackingbatcher- Checkpoint batching for efficient API callsexecution_state- Main execution state management
§Checkpoint Token Management
The SDK uses checkpoint tokens to ensure exactly-once checkpoint semantics:
-
Initial Token: The first checkpoint uses the
CheckpointTokenfrom theDurableExecutionInvocationInputprovided by Lambda. -
Token Updates: Each successful checkpoint returns a new token that MUST be used for the next checkpoint. The SDK automatically updates the token after each successful checkpoint.
-
Token Consumption: Once a token is used for a checkpoint, it is consumed and cannot be reused. Attempting to reuse a consumed token results in an
InvalidParameterValueExceptionerror. -
Error Handling: If a checkpoint fails with “Invalid checkpoint token”, the error is marked as retriable so Lambda can retry with a fresh token.
§Requirements
- 2.9: THE Checkpointing_System SHALL use the CheckpointToken from invocation input for the first checkpoint
- 2.10: THE Checkpointing_System SHALL use the returned CheckpointToken from each checkpoint response for subsequent checkpoints
- 2.11: THE Checkpointing_System SHALL handle InvalidParameterValueException for invalid tokens by allowing propagation for retry
Structs§
- Batch
Result - Result of processing a batch of checkpoints.
- Checkpoint
Batcher - The checkpoint batcher collects checkpoint requests and sends them in batches.
- Checkpoint
Batcher Config - Configuration for the checkpoint batcher.
- Checkpoint
Request - A request to checkpoint an operation.
- Checkpoint
Sender - Handle for sending checkpoint requests to the batcher.
- Checkpointed
Result - Result of checking for a checkpointed operation.
- Execution
State - Manages the execution state for a durable execution.
Enums§
- Replay
Status - Replay status indicating whether we’re replaying or executing new operations.
Functions§
- create_
checkpoint_ queue - Creates a checkpoint queue with the given buffer size.