public final class AsyncUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> CompletableFuture<T> |
completeExceptionally(Throwable throwable) |
static <T extends Throwable> |
rethrow(Throwable exception)
throws
exception as unchecked exception, without wrapping exception. |
static <T> T |
toSync(CompletableFuture<T> future) |
static <T> CompletableFuture<T> |
tryCatchSupplier(java.util.function.Supplier<T> supplier) |
static <T> CompletableFuture<T> |
tryCatchSupplierFuture(java.util.function.Supplier<CompletableFuture<T>> supplier) |
static void |
waitQuietly(CompletableFuture<?> future) |
public static <T> CompletableFuture<T> tryCatchSupplier(java.util.function.Supplier<T> supplier)
public static <T> CompletableFuture<T> tryCatchSupplierFuture(java.util.function.Supplier<CompletableFuture<T>> supplier)
public static <T> CompletableFuture<T> completeExceptionally(Throwable throwable)
public static <T extends Throwable> void rethrow(Throwable exception) throws T extends Throwable
exception as unchecked exception, without wrapping exception.exception - exception which will be rethrowT - exception as unchecked exceptionT extends Throwablepublic static <T> T toSync(CompletableFuture<T> future)
public static void waitQuietly(CompletableFuture<?> future)
Copyright © 2017–2021 The Apache Software Foundation. All rights reserved.