Interface IntervalFunction

  • All Superinterfaces:
    java.util.function.Function<java.lang.Integer,​java.lang.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 java.util.function.Function<java.lang.Integer,​java.lang.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.
    • Method Detail

      • 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,
                                   java.util.function.Function<java.lang.Long,​java.lang.Long> backoffFunction)
      • of

        static IntervalFunction of​(java.time.Duration interval,
                                   java.util.function.Function<java.lang.Long,​java.lang.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​(java.time.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​(java.time.Duration interval,
                                             double randomizationFactor)
      • ofRandomized

        static IntervalFunction ofRandomized​(java.time.Duration interval)
      • ofExponentialBackoff

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

        static IntervalFunction ofExponentialBackoff​(java.time.Duration initialInterval,
                                                     double multiplier,
                                                     java.time.Duration maxInterval)
      • ofExponentialBackoff

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

        static IntervalFunction ofExponentialBackoff​(java.time.Duration initialInterval,
                                                     double multiplier)
      • ofExponentialBackoff

        static IntervalFunction ofExponentialBackoff​(long initialIntervalMillis)
      • ofExponentialBackoff

        static IntervalFunction ofExponentialBackoff​(java.time.Duration initialInterval)
      • 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​(java.time.Duration initialInterval,
                                                           double multiplier,
                                                           double randomizationFactor,
                                                           java.time.Duration maxInterval)
      • ofExponentialRandomBackoff

        static IntervalFunction ofExponentialRandomBackoff​(java.time.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​(java.time.Duration initialInterval,
                                                           double multiplier,
                                                           java.time.Duration maxInterval)
      • ofExponentialRandomBackoff

        static IntervalFunction ofExponentialRandomBackoff​(java.time.Duration initialInterval,
                                                           double multiplier)
      • ofExponentialRandomBackoff

        static IntervalFunction ofExponentialRandomBackoff​(long initialIntervalMillis)
      • ofExponentialRandomBackoff

        static IntervalFunction ofExponentialRandomBackoff​(java.time.Duration initialInterval)
      • ofExponentialRandomBackoff

        static IntervalFunction ofExponentialRandomBackoff()