Modifier and Type | Method and Description |
---|---|
org.reactivestreams.Publisher<Long> |
apply(Flux<Long> companionValues) |
Repeat<T> |
backoff(Backoff backoff)
Returns a repeat function with backoff delay.
|
static <T> DefaultRepeat<T> |
create(Predicate<? super RepeatContext<T>> repeatPredicate,
long n)
Repeat function that repeats n times, only if the predicate returns true.
|
Repeat<T> |
doOnRepeat(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(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, wait
apply, exponentialBackoff, exponentialBackoffWithJitter, fixedBackoff, noBackoff, once, onlyIf, randomBackoff, times
public static <T> DefaultRepeat<T> create(Predicate<? super RepeatContext<T>> repeatPredicate, long n)
Repeat
public Repeat<T> withApplicationContext(T applicationContext)
Repeat
Repeat.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(Consumer<? super RepeatContext<T>> onRepeat)
Repeat
RepeatContext
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(Duration timeout)
Repeat
public Repeat<T> repeatMax(long maxRepeats)
Repeat
public Repeat<T> backoff(Backoff backoff)
Repeat
public Repeat<T> jitter(Jitter jitter)
Repeat
public Repeat<T> withBackoffScheduler(Scheduler scheduler)
Repeat
withBackoffScheduler
in interface Repeat<T>
scheduler
- the scheduler for backoff delays