@Test public void testBackoffMaxRepeats() throws Exception { Duration backoff = ofSeconds(1); testMaxRepeats(repeatWithConstantBackoff(1, backoff, timerExecutor), backoff); }
public static IntFunction<Completable> repeatWithConstantBackoff(final int maxRepeats, final Duration backoff, final Executor timerExecutor) { requireNonNull(timerExecutor); final long backoffNanos = backoff.toNanos(); return repeatCount -> { if (repeatCount > maxRepeats) { return terminateRepeat(); } return timerExecutor.timer(backoffNanos, NANOSECONDS); }; }
RepeatStrategies { public static IntFunction<Completable> repeatWithConstantBackoff(final int maxRepeats, final Duration backoff, final Executor timerExecutor) { requireNonNull(timerExecutor); final long backoffNanos = backoff.toNanos(); return repeatCount -> { if (repeatCount > maxRepeats) { return terminateRepeat(); } return timerExecutor.timer(backoffNanos, NANOSECONDS); }; } }
RepeatStrategies { public static IntFunction<Completable> repeatWithConstantBackoff(final int maxRepeats, final Duration backoff, final Executor timerExecutor) { requireNonNull(timerExecutor); final long backoffNanos = backoff.toNanos(); return repeatCount -> { if (repeatCount > maxRepeats) { return terminateRepeat(); } return timerExecutor.timer(backoffNanos, NANOSECONDS); }; } private  RepeatStrategies(); }
RepeatStrategies { public static IntFunction<Completable> repeatWithConstantBackoff(final int maxRepeats, final Duration backoff, final Executor timerExecutor) { requireNonNull(timerExecutor); final long backoffNanos = backoff.toNanos(); return repeatCount -> { if (repeatCount > maxRepeats) { return terminateRepeat(); } return timerExecutor.timer(backoffNanos, NANOSECONDS); }; } private  RepeatStrategies(); static IntFunction<Completable> repeatWithConstantBackoff(final int maxRepeats, final Duration backoff,
                                                                     final Executor timerExecutor); static IntFunction<Completable> repeatWithExponentialBackoff(final int maxRepeats,
                                                                        final Duration initialDelay,
                                                                        final Executor timerExecutor); static IntFunction<Completable> repeatWithExponentialBackoffAndJitter(final int maxRepeats,
                                                                                 final Duration initialDelay,
                                                                                 final Executor timerExecutor); }
RepeatStrategies { public static IntFunction<Completable> repeatWithConstantBackoff(final int maxRepeats, final Duration backoff, final Executor timerExecutor) { requireNonNull(timerExecutor); final long backoffNanos = backoff.toNanos(); return repeatCount -> { if (repeatCount > maxRepeats) { return terminateRepeat(); } return timerExecutor.timer(backoffNanos, NANOSECONDS); }; } private  RepeatStrategies(); static IntFunction<Completable> repeatWithConstantBackoff(final int maxRepeats, final Duration backoff,
                                                                     final Executor timerExecutor); static IntFunction<Completable> repeatWithExponentialBackoff(final int maxRepeats,
                                                                        final Duration initialDelay,
                                                                        final Executor timerExecutor); static IntFunction<Completable> repeatWithExponentialBackoffAndJitter(final int maxRepeats,
                                                                                 final Duration initialDelay,
                                                                                 final Executor timerExecutor);  }