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> void
synchronizeFutures
(io.netty.util.concurrent.Promise<T> promise, CompletableFuture<T> future) Synchronizespromise
andfuture
in both directions.static <T> CompletableFuture<T>
toFuture
(io.netty.util.concurrent.Future<T> future) Translates the NettyFuture
to aCompletableFuture
.
-
Method Details
-
toFuture
Translates the NettyFuture
to 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) Synchronizespromise
andfuture
in both directions.- Type Parameters:
T
-- Parameters:
promise
-future
-
-