Class RetryPolicy.Builder
java.lang.Object
io.superdurable.dex.RetryPolicy.Builder
- Enclosing class:
RetryPolicy
Builds immutable
RetryPolicy values.-
Method Summary
Modifier and TypeMethodDescriptionbackoffCoefficient(double value) Sets the multiplier applied to each successive retry interval.build()Builds an immutable retry policy from the current values.initialInterval(Duration value) Sets the delay before the first retry.maximumAttempts(int value) Limits the total number of attempts, including the initial attempt.maximumInterval(Duration value) Caps the delay between attempts.totalDuration(Duration value) Limits the total elapsed retry duration.
-
Method Details
-
initialInterval
Sets the delay before the first retry.- Parameters:
value- the initial retry interval, ornullfor the server default- Returns:
- this builder
-
backoffCoefficient
Sets the multiplier applied to each successive retry interval.- Parameters:
value- the exponential-backoff coefficient- Returns:
- this builder
-
maximumInterval
Caps the delay between attempts.- Parameters:
value- the maximum retry interval, ornullfor the server default- Returns:
- this builder
-
maximumAttempts
Limits the total number of attempts, including the initial attempt.- Parameters:
value- the maximum attempt count; zero leaves the server default- Returns:
- this builder
-
totalDuration
Limits the total elapsed retry duration.Step method retries default to four hours when this value is unset. An explicit value may be shorter or longer. It starts at the first Worker hand-out and is checked only after an attempt fails to decide whether to retry. It never ends a running attempt.
- Parameters:
value- the total retry duration, ornullfor the server default- Returns:
- this builder
-
build
Builds an immutable retry policy from the current values.- Returns:
- the configured retry policy
-