Constructor and Description |
---|
CommonCallableSupplier(Callable<T> call)
Create.
|
Modifier and Type | Method and Description |
---|---|
Object |
get() |
static void |
maybeAwaitCompletion(CompletableFuture<Void> future)
Block awaiting completion for any non-null future passed in;
No-op if a null arg was supplied.
|
static <T> CompletableFuture<T> |
submit(Executor executor,
Callable<T> call)
Submit a callable into a completable future.
|
static <T> void |
waitForCompletion(CompletableFuture<T> future)
Wait for a single of future to complete, extracting IOEs afterwards.
|
static <T> void |
waitForCompletion(List<CompletableFuture<T>> futures)
Wait for a list of futures to complete.
|
static <T> void |
waitForCompletionIgnoringExceptions(CompletableFuture<T> future)
Wait for a single of future to complete, ignoring exceptions raised.
|
public static <T> CompletableFuture<T> submit(Executor executor, Callable<T> call)
RuntimeIOException
instances.T
- typeexecutor
- executor.call
- call to invokepublic static <T> void waitForCompletion(List<CompletableFuture<T>> futures) throws IOException
futures
- list of futures.IOException
- if one of the called futures raised an IOE.RuntimeException
- if one of the futures raised one.public static <T> void waitForCompletion(CompletableFuture<T> future) throws IOException
future
- future to wait for.IOException
- if one of the called futures raised an IOE.RuntimeException
- if one of the futures raised one.public static <T> void waitForCompletionIgnoringExceptions(@Nullable CompletableFuture<T> future)
future
- future to wait for.public static void maybeAwaitCompletion(@Nullable CompletableFuture<Void> future) throws IOException
future
- futureIOException
- if one of the called futures raised an IOE.RuntimeException
- if one of the futures raised one.Copyright © 2008–2021 Apache Software Foundation. All rights reserved.