public class Async
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Async.CFFactory<T,U> |
static interface |
Async.CombinedBuilder<T> |
Constructor and Description |
---|
Async() |
Modifier and Type | Method and Description |
---|---|
static <T,U> java.util.concurrent.CompletableFuture<java.util.List<U>> |
each(java.util.Collection<T> list,
java.util.function.BiFunction<T,java.lang.Integer,java.util.concurrent.CompletableFuture<U>> cfFactory) |
static <T,U> java.util.concurrent.CompletableFuture<java.util.List<U>> |
eachSequentially(java.lang.Iterable<T> list,
Async.CFFactory<T,U> cfFactory) |
static <T> java.util.concurrent.CompletableFuture<T> |
exceptionallyCompletedFuture(java.lang.Throwable exception) |
static <T> Async.CombinedBuilder<T> |
ofExpectedSize(int expectedSize)
Combines 0 or more CF into one.
|
static <T> java.util.concurrent.CompletableFuture<T> |
toCompletableFuture(T t)
Turns an object T into a CompletableFuture if it's not already
|
static <T> java.util.concurrent.CompletableFuture<T> |
tryCatch(java.util.function.Supplier<java.util.concurrent.CompletableFuture<T>> supplier) |
public static <T> Async.CombinedBuilder<T> ofExpectedSize(int expectedSize)
CompletableFuture.allOf
.T
- for twoexpectedSize
- how many we expectpublic static <T,U> java.util.concurrent.CompletableFuture<java.util.List<U>> each(java.util.Collection<T> list, java.util.function.BiFunction<T,java.lang.Integer,java.util.concurrent.CompletableFuture<U>> cfFactory)
public static <T,U> java.util.concurrent.CompletableFuture<java.util.List<U>> eachSequentially(java.lang.Iterable<T> list, Async.CFFactory<T,U> cfFactory)
public static <T> java.util.concurrent.CompletableFuture<T> toCompletableFuture(T t)
T
- for twot
- - the object to checkpublic static <T> java.util.concurrent.CompletableFuture<T> tryCatch(java.util.function.Supplier<java.util.concurrent.CompletableFuture<T>> supplier)
public static <T> java.util.concurrent.CompletableFuture<T> exceptionallyCompletedFuture(java.lang.Throwable exception)