Enum Class StepSemantics

java.lang.Object
java.lang.Enum<StepSemantics>
software.amazon.lambda.durable.config.StepSemantics
All Implemented Interfaces:
Serializable, Comparable<StepSemantics>, Constable

public enum StepSemantics extends Enum<StepSemantics>
Delivery semantics for step operations.

Controls how the SDK handles step execution and interruption recovery. The guarantees apply per retry attempt, not per execution.

  • Enum Constant Details

    • AT_LEAST_ONCE

      public static final StepSemantics AT_LEAST_ONCE
      At-least-once delivery per retry attempt (default). The step may be re-executed if interrupted. START checkpoint is fire-and-forget.
    • AT_MOST_ONCE

      public static final StepSemantics AT_MOST_ONCE
      At-most-once delivery per retry attempt. START checkpoint is awaited before user code runs. If interrupted, throws StepInterruptedException.
    • AT_LEAST_ONCE_ASYNC

      @Experimental public static final StepSemantics AT_LEAST_ONCE_ASYNC
      At-least-once delivery per retry attempt, without waiting for the result checkpoint.

      Works like AT_LEAST_ONCE, with one change. The step returns its result as soon as the SUCCEED checkpoint is queued. It does not wait for the service to save it. So the step has lower latency.

      The code after the step can run before the result is saved. Checkpoints are sent in order, and the invocation does not end or suspend before the service answers the SUCCEED checkpoint. If that checkpoint fails, the invocation fails, and the step runs again on replay.

      On that replay the step can return a different value. Later steps then run again with the new value, and their earlier side effects used the old one. So do not use this mode for a step whose result becomes an idempotency key or a client token for a later step.

      Only the SUCCEED checkpoint is not awaited. A failed attempt waits for its RETRY or FAIL checkpoint.

    • AT_LEAST_ONCE_PER_RETRY

      @Deprecated public static final StepSemantics AT_LEAST_ONCE_PER_RETRY
      Deprecated.
      Use AT_LEAST_ONCE instead. It has the same behavior.
      At-least-once delivery per retry attempt.
    • AT_MOST_ONCE_PER_RETRY

      @Deprecated public static final StepSemantics AT_MOST_ONCE_PER_RETRY
      Deprecated.
      Use AT_MOST_ONCE instead. It has the same behavior.
      At-most-once delivery per retry attempt.
  • Method Details

    • values

      public static StepSemantics[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static StepSemantics valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null