public class DefaultRepeat<T> extends AbstractRetry<T,Long> implements Repeat<T>
| Modifier and Type | Method and Description |
|---|---|
Publisher<Long> |
apply(Flux<Long> companionValues) |
Repeat<T> |
backoff(Backoff backoff)
Returns a repeat function with backoff delay.
|
static <T> DefaultRepeat<T> |
create(java.util.function.Predicate<? super RepeatContext<T>> repeatPredicate,
long n)
Repeat function that repeats n times, only if the predicate returns true.
|
Repeat<T> |
doOnRepeat(java.util.function.Consumer<? super RepeatContext<T>> onRepeat)
Returns a repeat function that invokes the provided onRepeat
callback before every repeat.
|
Repeat<T> |
jitter(Jitter jitter)
Returns a repeat function that applies jitter to the backoff delay.
|
Repeat<T> |
repeatMax(long maxRepeats)
Returns a repeat function that repeats at most n times.
|
Repeat<T> |
timeout(java.time.Duration timeout)
Returns a repeat function with timeout.
|
String |
toString() |
Repeat<T> |
withApplicationContext(T applicationContext)
Returns a repeat function with an application context that may be
used to perform any rollbacks before a repeat.
|
Repeat<T> |
withBackoffScheduler(Scheduler scheduler)
Returns a repeat function that uses the scheduler provided for
backoff delays.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapply, exponentialBackoff, exponentialBackoffWithJitter, fixedBackoff, noBackoff, once, onlyIf, randomBackoff, timesandThen, compose, identitypublic static <T> DefaultRepeat<T> create(java.util.function.Predicate<? super RepeatContext<T>> repeatPredicate, long n)
Repeatpublic Repeat<T> withApplicationContext(T applicationContext)
RepeatRepeat.onlyIf(Predicate),
custom backoff function Repeat.backoff(Backoff) and repeat
callback Repeat.doOnRepeat(Consumer). All other properties of
this repeat function are retained in the returned instance.withApplicationContext in interface Repeat<T>applicationContext - Application contextpublic Repeat<T> doOnRepeat(java.util.function.Consumer<? super RepeatContext<T>> onRepeat)
RepeatRepeatContext provided
to the callback contains the iteration and the any application
context set using Repeat.withApplicationContext(Object).
All other properties of this repeat function are retained in the
returned instance.doOnRepeat in interface Repeat<T>onRepeat - callback to invoke before repeatspublic Repeat<T> timeout(java.time.Duration timeout)
Repeatpublic Repeat<T> repeatMax(long maxRepeats)
Repeatpublic Repeat<T> backoff(Backoff backoff)
Repeatpublic Repeat<T> jitter(Jitter jitter)
Repeatpublic Repeat<T> withBackoffScheduler(Scheduler scheduler)
RepeatwithBackoffScheduler in interface Repeat<T>scheduler - the scheduler for backoff delayspublic Publisher<Long> apply(Flux<Long> companionValues)
apply in interface java.util.function.Function<Flux<Long>,Publisher<Long>>