Interface WaitStrategy

All Known Implementing Classes:
ExponentialWaitStrategy
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface WaitStrategy
Operations that are polling for a result to arrive require a waiting time between consecutive polls. A WaitStrategy determines this waiting time.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    sleepTime(long attempt)
    Returns the time to wait until the next attempt.
  • Method Details

    • sleepTime

      long sleepTime(long attempt)
      Returns the time to wait until the next attempt. Attempts start at 0.
      Parameters:
      attempt - The number of the last attempt.
      Returns:
      Waiting time in ms.