@NotThreadSafe public class TimeoutRetry extends Object implements RetryPolicy
Constructor and Description |
---|
TimeoutRetry(long retryTimeoutMs,
int sleepMs)
Constructs a retry facility which allows retrying until a specified timeout is reached.
|
Modifier and Type | Method and Description |
---|---|
boolean |
attempt()
Waits until it is time to perform the next retry, then returns.
|
int |
getAttemptCount()
How many retries have been performed.
|
public TimeoutRetry(long retryTimeoutMs, int sleepMs)
retryTimeoutMs
- maximum period of time to retry for, in millisecondssleepMs
- time in milliseconds to sleep before retryingpublic int getAttemptCount()
RetryPolicy
getAttemptCount
in interface RetryPolicy
public boolean attempt()
RetryPolicy
attempt
in interface RetryPolicy
Copyright © 2023. All Rights Reserved.