@NotThreadSafe public class ExponentialBackoffRetry extends SleepingRetry
Constructor and Description |
---|
ExponentialBackoffRetry(int baseSleepTimeMs,
int maxSleepMs,
int maxRetries)
Constructs a new retry facility which sleeps for an exponentially increasing amount of time
between retries.
|
Modifier and Type | Method and Description |
---|---|
protected long |
getSleepTime()
How long to sleep before the next retry is performed.
|
attempt, getAttemptCount, getSleepUnit
public ExponentialBackoffRetry(int baseSleepTimeMs, int maxSleepMs, int maxRetries)
baseSleepTimeMs
- the sleep in milliseconds to begin withmaxSleepMs
- the max sleep in milliseconds as a boundingmaxRetries
- the max count of retriesprotected long getSleepTime()
SleepingRetry
SleepingRetry.getSleepUnit()
, so all time given here must match the unit provided.getSleepTime
in class SleepingRetry
Copyright © 2023. All Rights Reserved.