Interface IBackoffStrategy

All Known Implementing Classes:
ExponentialBackoffStrategy

public interface IBackoffStrategy
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    get()
    Increments the failure count and computes the appropriate exponential backoff.
    int
    Returns the current failure count
    void
    Resets the failure count for exponential backoff calculations.
    default boolean
    Sleeps for the delay suggested by get().
  • Method Details

    • sleep

      default boolean sleep()
      Sleeps for the delay suggested by get().
      Returns:
      whether the sleep was successful (could be false if maximum attempts have been hit, for example).
    • get

      long get()
      Increments the failure count and computes the appropriate exponential backoff.
      Returns:
      the amount of milliseconds to delay before retrying.
    • reset

      void reset()
      Resets the failure count for exponential backoff calculations.
    • getFailures

      int getFailures()
      Returns the current failure count
      Returns:
      failure count