Class FutureUtils
- java.lang.Object
-
- io.servicetalk.concurrent.internal.FutureUtils
-
public final class FutureUtils extends java.lang.Object
A set of utilities for interacting withFuture
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
awaitResult(java.util.concurrent.Future<T> future)
Await the completion of the passedFuture
and return its result.static void
awaitTermination(java.util.concurrent.Future<java.lang.Void> future)
Await the completion of the passedFuture
.
-
-
-
Method Detail
-
awaitTermination
public static void awaitTermination(java.util.concurrent.Future<java.lang.Void> future)
Await the completion of the passedFuture
.- Parameters:
future
-Future
to await termination.
-
awaitResult
public static <T> T awaitResult(java.util.concurrent.Future<T> future)
Await the completion of the passedFuture
and return its result.- Type Parameters:
T
- the result type.- Parameters:
future
-Future
to await completion.- Returns:
- the result of the
Future
.
-
-