Class FutureUtils
- java.lang.Object
-
- io.servicetalk.concurrent.internal.FutureUtils
-
public final class FutureUtils extends java.lang.ObjectA set of utilities for interacting withFuture.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TawaitResult(java.util.concurrent.Future<T> future)Await the completion of the passedFutureand return its result.static voidawaitTermination(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-Futureto await termination.
-
awaitResult
public static <T> T awaitResult(java.util.concurrent.Future<T> future)
Await the completion of the passedFutureand return its result.- Type Parameters:
T- the result type.- Parameters:
future-Futureto await completion.- Returns:
- the result of the
Future.
-
-