public class ExponentialBackoff extends Object
| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_JITTER |
static Duration |
MAX_BACKOFF |
| Modifier and Type | Method and Description |
|---|---|
static Function<Multi<Throwable>,org.reactivestreams.Publisher<Long>> |
randomExponentialBackoffFunction(long numRetries,
Duration firstBackoff,
Duration maxBackoff,
double jitterFactor,
ScheduledExecutorService executor)
Computes a method that would delay ticks using an exponential backoff.
|
static Function<Multi<Throwable>,org.reactivestreams.Publisher<Long>> |
randomExponentialBackoffFunctionExpireAt(long expireAt,
Duration firstBackoff,
Duration maxBackoff,
double jitterFactor,
ScheduledExecutorService executor)
Computes a method that would delay ticks using an exponential backoff.
|
public static final Duration MAX_BACKOFF
public static final double DEFAULT_JITTER
public static Function<Multi<Throwable>,org.reactivestreams.Publisher<Long>> randomExponentialBackoffFunction(long numRetries, Duration firstBackoff, Duration maxBackoff, double jitterFactor, ScheduledExecutorService executor)
numRetries - the max number of retriesfirstBackoff - the delay of the first backoffmaxBackoff - the max backoffjitterFactor - the jitter factor in [0, 1]executor - the executor used for the delaypublic static Function<Multi<Throwable>,org.reactivestreams.Publisher<Long>> randomExponentialBackoffFunctionExpireAt(long expireAt, Duration firstBackoff, Duration maxBackoff, double jitterFactor, ScheduledExecutorService executor)
expireAt - absolute time in millis that specifies when to give up.firstBackoff - the delay of the first backoffmaxBackoff - the max backoffjitterFactor - the jitter factor in [0, 1]executor - the executor used for the delayCopyright © 2019–2020 SmallRye. All rights reserved.