public final class FutureUtils
extends Object
A set of utilities for interacting with
Future
.
-
Method Summary
static <T> T
Await the completion of the passed
Future
and return its result.
static void
Await the completion of the passed
Future
.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
awaitTermination
public static void awaitTermination(Future<Void> future)
Await the completion of the passed
Future
.
- Parameters:
future
- Future
to await termination.
-
awaitResult
public static <T> T awaitResult(Future<T> future)
Await the completion of the passed
Future
and return its result.
- Type Parameters:
T
- the result type.
- Parameters:
future
- Future
to await completion.
- Returns:
- the result of the
Future
.