Class JsFutures


  • public class JsFutures
    extends Object
    • Constructor Detail

      • JsFutures

        public JsFutures()
    • 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 supplier
        maxRetries - the number of retries
        Returns:
        a new CompletableFuture wrapped in a supplier