Interface IntervalFunction

All Superinterfaces:
Function<Integer,Long>
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 IntervalFunction extends Function<Integer,Long>
An IntervalFunction which can be used to calculate the wait interval. The input parameter of the function is the number of attempts (attempt), the output parameter the wait interval in milliseconds. The attempt parameter starts at 1 and increases with every further attempt.
  • Field Details

  • Method Details

    • ofDefaults

      static IntervalFunction ofDefaults()
      Creates an IntervalFunction which returns a fixed default interval of 500 [ms].
      Returns:
      returns an IntervalFunction which returns a fixed default interval of 500 [ms]
    • of

      static IntervalFunction of(long intervalMillis, Function<Long,Long> backoffFunction)
    • of

      static IntervalFunction of(Duration interval, Function<Long,Long> backoffFunction)
    • of

      static IntervalFunction of(long intervalMillis)
      Creates an IntervalFunction which returns a fixed interval in milliseconds.
      Parameters:
      intervalMillis - the interval in milliseconds
      Returns:
      an IntervalFunction which returns a fixed interval in milliseconds.
    • of

      static IntervalFunction of(Duration interval)
      Creates an IntervalFunction which returns a fixed interval specified by a given Duration.
      Parameters:
      interval - the interval
      Returns:
      an IntervalFunction which returns a fixed interval specified by a given Duration.
    • ofRandomized

      static IntervalFunction ofRandomized(long intervalMillis, double randomizationFactor)
    • ofRandomized

      static IntervalFunction ofRandomized(Duration interval, double randomizationFactor)
    • ofRandomized

      static IntervalFunction ofRandomized(long intervalMillis)
    • ofRandomized

      static IntervalFunction ofRandomized(Duration interval)
    • ofRandomized

      static IntervalFunction ofRandomized()
    • ofExponentialBackoff

      static IntervalFunction ofExponentialBackoff(long initialIntervalMillis, double multiplier, long maxIntervalMillis)
    • ofExponentialBackoff

      static IntervalFunction ofExponentialBackoff(Duration initialInterval, double multiplier, Duration maxInterval)
    • ofExponentialBackoff

      static IntervalFunction ofExponentialBackoff(long initialIntervalMillis, double multiplier)
    • ofExponentialBackoff

      static IntervalFunction ofExponentialBackoff(Duration initialInterval, double multiplier)
    • ofExponentialBackoff

      static IntervalFunction ofExponentialBackoff(long initialIntervalMillis)
    • ofExponentialBackoff

      static IntervalFunction ofExponentialBackoff(Duration initialInterval)
    • ofExponentialBackoff

      static IntervalFunction ofExponentialBackoff()
    • ofExponentialRandomBackoff

      static IntervalFunction ofExponentialRandomBackoff(long initialIntervalMillis, double multiplier, double randomizationFactor, long maxIntervalMillis)
    • ofExponentialRandomBackoff

      static IntervalFunction ofExponentialRandomBackoff(long initialIntervalMillis, double multiplier, double randomizationFactor)
    • ofExponentialRandomBackoff

      static IntervalFunction ofExponentialRandomBackoff(Duration initialInterval, double multiplier, double randomizationFactor, Duration maxInterval)
    • ofExponentialRandomBackoff

      static IntervalFunction ofExponentialRandomBackoff(Duration initialInterval, double multiplier, double randomizationFactor)
    • ofExponentialRandomBackoff

      static IntervalFunction ofExponentialRandomBackoff(long initialIntervalMillis, double multiplier, long maxIntervalMillis)
    • ofExponentialRandomBackoff

      static IntervalFunction ofExponentialRandomBackoff(long initialIntervalMillis, double multiplier)
    • ofExponentialRandomBackoff

      static IntervalFunction ofExponentialRandomBackoff(Duration initialInterval, double multiplier, Duration maxInterval)
    • ofExponentialRandomBackoff

      static IntervalFunction ofExponentialRandomBackoff(Duration initialInterval, double multiplier)
    • ofExponentialRandomBackoff

      static IntervalFunction ofExponentialRandomBackoff(long initialIntervalMillis)
    • ofExponentialRandomBackoff

      static IntervalFunction ofExponentialRandomBackoff(Duration initialInterval)
    • ofExponentialRandomBackoff

      static IntervalFunction ofExponentialRandomBackoff()