@FunctionalInterface public interface IntervalFunction extends Serializable
Modifier and Type | Method and Description |
---|---|
static IntervalFunction |
constant(long intervalMs)
Creates an
IntervalFunction which returns a fixed interval in
milliseconds. |
static IntervalFunction |
exponentialBackoff(long intervalMillis,
double multiplier)
Creates an
IntervalFunction which starts from the specified wait
interval, on the first attempt, and for each subsequent attempt uses
a longer interval, equal to the previous wait duration multiplied by the
provided scaling factor (so for example: 1, 2, 4, 8, ...). |
static IntervalFunction |
exponentialBackoffWithCap(long intervalMillis,
double multiplier,
long capMillis)
Creates an
IntervalFunction which starts from the specified wait
interval, on the first attempt, and for each subsequent attempt uses
a longer interval, equal to the previous wait duration multiplied by the
provided scaling factor (so for example: 1, 2, 4, 8, ...). |
long |
waitAfterAttempt(int attempt)
Returns the wait time required before the specified attempt.
|
static IntervalFunction constant(long intervalMs)
IntervalFunction
which returns a fixed interval in
milliseconds.static IntervalFunction exponentialBackoff(long intervalMillis, double multiplier)
IntervalFunction
which starts from the specified wait
interval, on the first attempt, and for each subsequent attempt uses
a longer interval, equal to the previous wait duration multiplied by the
provided scaling factor (so for example: 1, 2, 4, 8, ...).static IntervalFunction exponentialBackoffWithCap(long intervalMillis, double multiplier, long capMillis)
IntervalFunction
which starts from the specified wait
interval, on the first attempt, and for each subsequent attempt uses
a longer interval, equal to the previous wait duration multiplied by the
provided scaling factor (so for example: 1, 2, 4, 8, ...). The wait
interval increases only until a certain maximum value, ie. is capped. All
subsequent wait intervals returned will be equal to the cap.long waitAfterAttempt(int attempt)
Copyright © 2023 Hazelcast, Inc.. All rights reserved.