Package jsonvalues.future
Class JsFutures
- java.lang.Object
-
- jsonvalues.future.JsFutures
-
public class JsFutures extends Object
-
-
Constructor Summary
Constructors Constructor Description JsFutures()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <R> Supplier<CompletableFuture<R>>
retry(Supplier<CompletableFuture<R>> supplier, int maxRetries)
it creates a new future that retries a number of times the given one when an exception is produced
-
-
-
Method Detail
-
retry
public static <R> Supplier<CompletableFuture<R>> retry(Supplier<CompletableFuture<R>> supplier, int maxRetries)
it creates a new future that retries a number of times the given one when an exception is produced- Type Parameters:
R
- the type of the value returned when the future is completed- Parameters:
supplier
- the completable future wrapped in a suppliermaxRetries
- the number of retries- Returns:
- a new CompletableFuture wrapped in a supplier
-
-