Interface RetryStrategy
- All Known Implementing Classes:
RetryStrategy.AdaptiveExponential,RetryStrategy.ConstantInterval,RetryStrategy.NoRetries$,RetryStrategy.Repeat,RetryStrategy.SoftTimeout,RetryStrategy.StickyCeiling
public interface RetryStrategy
A strategy for determine whether and when to retry an operation
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA strategy that starts with some initial interval, and then picks the next interval so that it is the longer of the duration of the last request or an exponential increase over the previous interval.static classstatic final classA strategy that constantly returns the given intervalstatic classstatic classstatic final classstatic classstatic final classstatic classstatic final classstatic class -
Method Summary
Modifier and TypeMethodDescriptionscala.util.Either<String,scala.Tuple2<scala.concurrent.duration.FiniteDuration, RetryStrategy>> apply(scala.concurrent.duration.FiniteDuration attemptDuration) Decides whether and when to retry an operation, given the duration of the most recent attempt.
-
Method Details
-
apply
scala.util.Either<String,scala.Tuple2<scala.concurrent.duration.FiniteDuration, applyRetryStrategy>> (scala.concurrent.duration.FiniteDuration attemptDuration) Decides whether and when to retry an operation, given the duration of the most recent attempt.Why is this signature so complex, you ask? To be able to express both limits on retrying, and to support the logic of
RetryStrategy.AdaptiveExponential.- Parameters:
attemptDuration- duration of the most recent attempt- Returns:
- a
Leftcontaining the reason for not retrying the request if the operation should not be retried, or aRightcontaining the minimum interval between the start of the most recent attempt and the start of the retry together with the RetryStrategy to use if this retry fails.
-