This commit is contained in:
Arjen Poutsma
2022-07-27 13:54:09 +02:00
parent 2aa74c9121
commit b38a5df563

View File

@@ -41,6 +41,7 @@ public abstract class FutureUtils {
* @param callable a function that returns the value to be used, or throws
* an exception
* @return the new CompletableFuture
* @see CompletableFuture#supplyAsync(Supplier)
*/
public static <T> CompletableFuture<T> callAsync(Callable<T> callable) {
Assert.notNull(callable, "Callable must not be null");
@@ -52,11 +53,12 @@ public abstract class FutureUtils {
/**
* Return a new {@code CompletableFuture} that is asynchronously completed
* by a task running in the given executor with the value obtained
* by calling the given Supplier.
* by calling the given {@code Callable}.
* @param callable a function that returns the value to be used, or throws
* an exception
* @param executor the executor to use for asynchronous execution
* @return the new CompletableFuture
* @see CompletableFuture#supplyAsync(Supplier, Executor)
*/
public static <T> CompletableFuture<T> callAsync(Callable<T> callable, Executor executor) {
Assert.notNull(callable, "Callable must not be null");