Package io.atlassian.fugue.retry
Class BeforeRetryExponentialBackoffTask
java.lang.Object
io.atlassian.fugue.retry.BeforeRetryExponentialBackoffTask
- All Implemented Interfaces:
Runnable
A backoff task for use in a retry -function, -supplier, or -task. This should
be used as the beforeRetry hook. Upon each execution, the amount of time to
wait before retrying the function call is doubled.
This class maintains an internal state; we recommend creating a new instance
for each use.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBeforeRetryExponentialBackoffTask(long backoffMillis) Constructor for BeforeRetryExponentialBackoffTask. -
Method Summary
Modifier and TypeMethodDescription(package private) longvoidrun()This method causes the current thread to sleep for a duration which doubles after each successive call.
-
Field Details
-
backoff
private long backoff
-
-
Constructor Details
-
BeforeRetryExponentialBackoffTask
public BeforeRetryExponentialBackoffTask(long backoffMillis) Constructor for BeforeRetryExponentialBackoffTask.
- Parameters:
backoffMillis- the amount of time to wait, in milliseconds before retrying the first time. This is doubled for each subsequent retry. This parameter must be above zero.
-
-
Method Details