Enum Class StepSemantics
- All Implemented Interfaces:
Serializable,Comparable<StepSemantics>,Constable
Controls how the SDK handles step execution and interruption recovery. The guarantees apply per retry attempt, not per execution.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAt-least-once delivery per retry attempt (default).At-least-once delivery per retry attempt, without waiting for the result checkpoint.Deprecated.At-most-once delivery per retry attempt.Deprecated.UseAT_MOST_ONCEinstead. -
Method Summary
Modifier and TypeMethodDescriptionstatic StepSemanticsReturns the enum constant of this class with the specified name.static StepSemantics[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
At-most-once delivery per retry attempt. START checkpoint is awaited before user code runs. If interrupted, throwsStepInterruptedException. -
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.UseAT_LEAST_ONCEinstead. It has the same behavior.At-least-once delivery per retry attempt. -
AT_MOST_ONCE_PER_RETRY
Deprecated.UseAT_MOST_ONCEinstead. It has the same behavior.At-most-once delivery per retry attempt.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
AT_LEAST_ONCEinstead.