Package org.drasyl.util
Class FutureUtil
java.lang.Object
org.drasyl.util.FutureUtil
Utility class for future-related operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidsynchronizeFutures(io.netty.util.concurrent.Promise<T> promise, CompletableFuture<T> future) Synchronizespromiseandfuturein both directions.static <T> CompletableFuture<T>toFuture(io.netty.util.concurrent.Future<T> future) Translates the NettyFutureto aCompletableFuture.
-
Method Details
-
toFuture
Translates the NettyFutureto aCompletableFuture.- Type Parameters:
T- The result type of the future- Parameters:
future- The future to be translated- Returns:
- The translated
CompletableFuture
-
synchronizeFutures
public static <T> void synchronizeFutures(io.netty.util.concurrent.Promise<T> promise, CompletableFuture<T> future) Synchronizespromiseandfuturein both directions.- Type Parameters:
T-- Parameters:
promise-future-
-