Package io.github.resilience4j.core
Interface IntervalFunction
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An IntervalFunction which can be used to calculate the wait interval. The input parameter of the
function is the number of attempts (attempt), the output parameter the wait interval in
milliseconds. The attempt parameter starts at 1 and increases with every further attempt.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final doublestatic final double -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic IntervalFunctionof(long intervalMillis) Creates an IntervalFunction which returns a fixed interval in milliseconds.static IntervalFunctionstatic IntervalFunctionCreates an IntervalFunction which returns a fixed interval specified by a givenDuration.static IntervalFunctionstatic IntervalFunctionCreates an IntervalFunction which returns a fixed default interval of 500 [ms].static IntervalFunctionstatic IntervalFunctionofExponentialBackoff(long initialIntervalMillis) static IntervalFunctionofExponentialBackoff(long initialIntervalMillis, double multiplier) static IntervalFunctionofExponentialBackoff(long initialIntervalMillis, double multiplier, long maxIntervalMillis) static IntervalFunctionofExponentialBackoff(Duration initialInterval) static IntervalFunctionofExponentialBackoff(Duration initialInterval, double multiplier) static IntervalFunctionofExponentialBackoff(Duration initialInterval, double multiplier, Duration maxInterval) static IntervalFunctionstatic IntervalFunctionofExponentialRandomBackoff(long initialIntervalMillis) static IntervalFunctionofExponentialRandomBackoff(long initialIntervalMillis, double multiplier) static IntervalFunctionofExponentialRandomBackoff(long initialIntervalMillis, double multiplier, double randomizationFactor) static IntervalFunctionofExponentialRandomBackoff(long initialIntervalMillis, double multiplier, double randomizationFactor, long maxIntervalMillis) static IntervalFunctionofExponentialRandomBackoff(long initialIntervalMillis, double multiplier, long maxIntervalMillis) static IntervalFunctionofExponentialRandomBackoff(Duration initialInterval) static IntervalFunctionofExponentialRandomBackoff(Duration initialInterval, double multiplier) static IntervalFunctionofExponentialRandomBackoff(Duration initialInterval, double multiplier, double randomizationFactor) static IntervalFunctionofExponentialRandomBackoff(Duration initialInterval, double multiplier, double randomizationFactor, Duration maxInterval) static IntervalFunctionofExponentialRandomBackoff(Duration initialInterval, double multiplier, Duration maxInterval) static IntervalFunctionstatic IntervalFunctionofRandomized(long intervalMillis) static IntervalFunctionofRandomized(long intervalMillis, double randomizationFactor) static IntervalFunctionofRandomized(Duration interval) static IntervalFunctionofRandomized(Duration interval, double randomizationFactor)
-
Field Details
-
DEFAULT_INITIAL_INTERVAL
static final long DEFAULT_INITIAL_INTERVAL- See Also:
-
DEFAULT_MULTIPLIER
static final double DEFAULT_MULTIPLIER- See Also:
-
DEFAULT_RANDOMIZATION_FACTOR
static final double DEFAULT_RANDOMIZATION_FACTOR- See Also:
-
-
Method Details
-
ofDefaults
Creates an IntervalFunction which returns a fixed default interval of 500 [ms].- Returns:
- returns an IntervalFunction which returns a fixed default interval of 500 [ms]
-
of
-
of
-
of
Creates an IntervalFunction which returns a fixed interval in milliseconds.- Parameters:
intervalMillis- the interval in milliseconds- Returns:
- an IntervalFunction which returns a fixed interval in milliseconds.
-
of
Creates an IntervalFunction which returns a fixed interval specified by a givenDuration.- Parameters:
interval- the interval- Returns:
- an IntervalFunction which returns a fixed interval specified by a given
Duration.
-
ofRandomized
-
ofRandomized
-
ofRandomized
-
ofRandomized
-
ofRandomized
-
ofExponentialBackoff
static IntervalFunction ofExponentialBackoff(long initialIntervalMillis, double multiplier, long maxIntervalMillis) -
ofExponentialBackoff
static IntervalFunction ofExponentialBackoff(Duration initialInterval, double multiplier, Duration maxInterval) -
ofExponentialBackoff
-
ofExponentialBackoff
-
ofExponentialBackoff
-
ofExponentialBackoff
-
ofExponentialBackoff
-
ofExponentialRandomBackoff
static IntervalFunction ofExponentialRandomBackoff(long initialIntervalMillis, double multiplier, double randomizationFactor, long maxIntervalMillis) -
ofExponentialRandomBackoff
static IntervalFunction ofExponentialRandomBackoff(long initialIntervalMillis, double multiplier, double randomizationFactor) -
ofExponentialRandomBackoff
static IntervalFunction ofExponentialRandomBackoff(Duration initialInterval, double multiplier, double randomizationFactor, Duration maxInterval) -
ofExponentialRandomBackoff
static IntervalFunction ofExponentialRandomBackoff(Duration initialInterval, double multiplier, double randomizationFactor) -
ofExponentialRandomBackoff
static IntervalFunction ofExponentialRandomBackoff(long initialIntervalMillis, double multiplier, long maxIntervalMillis) -
ofExponentialRandomBackoff
-
ofExponentialRandomBackoff
static IntervalFunction ofExponentialRandomBackoff(Duration initialInterval, double multiplier, Duration maxInterval) -
ofExponentialRandomBackoff
-
ofExponentialRandomBackoff
-
ofExponentialRandomBackoff
-
ofExponentialRandomBackoff
-