Package io.atlassian.fugue.retry
Class BeforeRetryLinearBackoffTask
java.lang.Object
io.atlassian.fugue.retry.BeforeRetryLinearBackoffTask
- 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 current thread
sleeps for the time specified at construction.
This class is thread safe and contains no internal state, hence instances can
be reused and the same instance can be used on multiple threads.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBeforeRetryLinearBackoffTask(long backoffMillis) Constructor for BeforeRetryLinearBackoffTask. -
Method Summary
Modifier and TypeMethodDescription(package private) longvoidrun()This method causes the current thread to sleep for the time specified when the instance is constructed.
-
Field Details
-
backoff
private final long backoff
-
-
Constructor Details
-
BeforeRetryLinearBackoffTask
public BeforeRetryLinearBackoffTask(long backoffMillis) Constructor for BeforeRetryLinearBackoffTask.
- Parameters:
backoffMillis- the time to wait whenever run is executed
-
-
Method Details