Enum Class JitterType
- All Implemented Interfaces:
Serializable,Comparable<JitterType>,java.lang.constant.Constable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-21T06:34:16.711Z")
@Stability(Stable)
public enum JitterType
extends Enum<JitterType>
Values allowed in the retrier JitterStrategy field.
Example:
Parallel parallel = new Parallel(this, "Do the work in parallel");
// Add branches to be executed in parallel
Pass shipItem = new Pass(this, "ShipItem");
Pass sendInvoice = new Pass(this, "SendInvoice");
Pass restock = new Pass(this, "Restock");
parallel.branch(shipItem);
parallel.branch(sendInvoice);
parallel.branch(restock);
// Retry the whole workflow if something goes wrong with exponential backoff
parallel.addRetry(RetryProps.builder()
.maxAttempts(1)
.maxDelay(Duration.seconds(5))
.jitterStrategy(JitterType.FULL)
.build());
// How to recover from errors
Pass sendFailureNotification = new Pass(this, "SendFailureNotification");
parallel.addCatch(sendFailureNotification);
// What to do in case everything succeeded
Pass closeOrder = new Pass(this, "CloseOrder");
parallel.next(closeOrder);
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic JitterTypeReturns the enum constant of this class with the specified name.static JitterType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FULL
Calculates the delay to be a random number between 0 and the computed backoff for the given retry attempt count. -
NONE
Calculates the delay to be the computed backoff for the given retry attempt count (equivalent to if Jitter was not declared - i.e. the default value).
-
-
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
-