Class BeforeRetryLinearBackoffTask

java.lang.Object
io.atlassian.fugue.retry.BeforeRetryLinearBackoffTask
All Implemented Interfaces:
Runnable

public class BeforeRetryLinearBackoffTask extends Object implements 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 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

    • 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:
      run in interface Runnable
    • currentBackoff

      long currentBackoff()