servicetalk-concurrent-api/src/main/java/io/servicetalk/concurrent/api/RepeatStrategies.java
/**
     * Creates a new repeat function that adds a delay between repeats. For first repeat, the delay is
     * {@code initialDelay} which is increased exponentially for subsequent repeats.
     * This additionally adds a "Full Jitter" for the backoff as described
     * <a href="https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/">here</a>.
     *
     * @param initialDelay Delay {@link Duration} for the first repeat and increased exponentially with each repeat.
     * @param maxDelay The maximum amount of delay that will be introduced.
     * @param timerExecutor {@link Executor} to be used to schedule timers for backoff.
     *
     * @return An {@link IntFunction} to be used for repeats which given a repeat count returns a {@link Completable}
     * that terminates successfully when the source has to be repeated or terminates with error if the source should not
     * be repeated.
     */
Creates a new repeat function that adds a delay between repeats. For first repeat, the delay is
initialDelay which is increased exponentially for subsequent repeats.
This additionally adds a "Full Jitter" for the backoff as described
here.

@param initialDelay Delay  Duration for the first repeat and increased exponentially with each repeat.
@param maxDelay The maximum amount of delay that will be introduced.
@param timerExecutor  Executor to be used to schedule timers for backoff.

@return An  IntFunction to be used for repeats which given a repeat count returns a  Completable
that terminates successfully when the source has to be repeated or terminates with error if the source should not
be repeated.
Creates a new repeat function that adds a delay between repeats . For first repeat the delay is initialDelay which is increased exponentially for subsequent repeats . This additionally adds a " Full Jitter " for the backoff as described here . @param initialDelay Delay Duration for the first repeat and increased exponentially with each repeat . @param maxDelay The maximum amount of delay that will be introduced . @param timerExecutor Executor to be used to schedule timers for backoff . @return An IntFunction to be used for repeats which given a repeat count returns a Completable that terminates successfully when the source has to be repeated or terminates with error if the source should not be repeated .
public static IntFunction<Completable> repeatWithExponentialBackoffFullJitter(final Duration initialDelay,
                                                                                  final Duration maxDelay,
                                                                                  final Executor timerExecutor) {
        requireNonNull(timerExecutor);
        final long initialDelayNanos = initialDelay.toNanos();
        final long maxDelayNanos = maxDelay.toNanos();
        final long maxInitialShift = maxShift(initialDelayNanos);
        return repeatCount -> timerExecutor.timer(current().nextLong(0,
                baseDelayNanos(initialDelayNanos, maxDelayNanos, maxInitialShift, repeatCount)), NANOSECONDS);
    }
public static IntFunction < Completable > repeatWithExponentialBackoffFullJitter ( final Duration initialDelay , final Duration maxDelay , final Executor timerExecutor ) { requireNonNull ( timerExecutor ) ; final long initialDelayNanos = initialDelay . toNanos ( ) ; final long maxDelayNanos = maxDelay . toNanos ( ) ; final long maxInitialShift = maxShift ( initialDelayNanos ) ; return repeatCount -> timerExecutor . timer ( current ( ) . nextLong ( 0 , baseDelayNanos ( initialDelayNanos , maxDelayNanos , maxInitialShift , repeatCount ) ) , NANOSECONDS ) ; }
Creates a new repeat function that adds a delay between repeats.
Creates a new repeat function that adds a delay between repeats .