Package io.atlassian.fugue.retry
Class BeforeRetryLinearBackoffTask
- java.lang.Object
-
- io.atlassian.fugue.retry.BeforeRetryLinearBackoffTask
-
- All Implemented Interfaces:
java.lang.Runnable
public class BeforeRetryLinearBackoffTask extends java.lang.Object implements java.lang.RunnableA 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 Modifier and Type Field Description private longbackoff
-
Constructor Summary
Constructors Constructor Description BeforeRetryLinearBackoffTask(long backoffMillis)Constructor for BeforeRetryLinearBackoffTask.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) longcurrentBackoff()voidrun()This method causes the current thread to sleep for the time specified when the instance is constructed.
-
-
-
Method Detail
-
run
public void run()
This method causes the current thread to sleep for the time specified when the instance is constructed. InterruptedExceptions are wrapped before being rethrown in a RuntimeException.- Specified by:
runin interfacejava.lang.Runnable
-
currentBackoff
long currentBackoff()
-
-