Uses of Class
com.google.mu.util.concurrent.Retryer.Delay
Package
Description
Parallelizer (parallel stream using Executor), Retryer.
-
Uses of Retryer.Delay in com.google.mu.util.concurrent
Modifier and TypeMethodDescriptionfinal <T extends Retryer.Delay<?>>
List<T> Returns a view oflist
that while not modifiable, will become empty whenduration()
has elapsed since the time the view was created as if another thread had just concurrently removed all elements from it.final <T extends Retryer.Delay<?>>
List<T> Returns a view oflist
that while not modifiable, will become empty whenduration()
has elapsed since the time the view was created as if another thread had just concurrently removed all elements from it.Modifier and TypeMethodDescriptionfinal Retryer.Delay
<E> Retryer.Delay.multipliedBy
(double multiplier) Returns a newDelay
with duration multiplied bymultiplier
.static <E> Retryer.Delay
<E> Returns aDelay
ofduration
.static <E> Retryer.Delay
<E> Retryer.Delay.ofMillis
(long millis) Shorthand forof(Duration.ofMillis(millis))
.final Retryer.Delay
<E> Retryer.Delay.randomized
(Random random, double randomness) Returns a newDelay
with some extra randomness.Modifier and TypeMethodDescriptionfinal List
<Retryer.Delay<E>> Retryer.Delay.exponentialBackoff
(double multiplier, int size) Returns an immutableList
of delays withsize
.final List
<Retryer.Delay<E>> Retryer.Delay.fibonacci
(int size) Returns a fibonacci list of delays ofsize
, as in1, 1, 2, 3, 5, 8, ...
withthis
delay being the multiplier.Modifier and TypeMethodDescription<T> Retryer.ForReturnValue
<T> Retryer.ifReturns
(Predicate<T> condition, List<? extends Retryer.Delay<? super T>> delays) Returns a new object that retries if the return value satisfiescondition
.<T> Retryer.ForReturnValue
<T> Retryer.ifReturns
(Predicate<T> condition, Stream<? extends Retryer.Delay<? super T>> delays) Returns a new object that retries if the return value satisfiescondition
.Retryer.upon
(Class<E> exceptionType, Predicate<? super E> condition, List<? extends Retryer.Delay<? super E>> delays) Returns a newRetryer
that usesdelays
when an exception is instance ofexceptionType
and satisfiescondition
.Retryer.upon
(Class<E> exceptionType, Predicate<? super E> condition, Stream<? extends Retryer.Delay<? super E>> delays) Returns a newRetryer
that usesdelays
when an exception is instance ofexceptionType
and satisfiescondition
.Retryer.upon
(Class<E> exceptionType, List<? extends Retryer.Delay<? super E>> delays) Returns a newRetryer
that usesdelays
when an exception is instance ofexceptionType
.Retryer.upon
(Class<E> exceptionType, Stream<? extends Retryer.Delay<? super E>> delays) Returns a newRetryer
that usesdelays
when an exception is instance ofexceptionType
.<T> Retryer.ForReturnValue
<T> Retryer.uponReturn
(T returnValue, List<? extends Retryer.Delay<? super T>> delays) Returns a new object that retries if the function returnsreturnValue
.<T> Retryer.ForReturnValue
<T> Retryer.uponReturn
(T returnValue, Stream<? extends Retryer.Delay<? super T>> delays) Returns a new object that retries if the function returnsreturnValue
.