Class FutureUtil

java.lang.Object
org.drasyl.util.FutureUtil

public final class FutureUtil extends Object
Utility class for future-related operations.
  • Method Details

    • toFuture

      public static <T> CompletableFuture<T> toFuture(io.netty.util.concurrent.Future<T> future)
      Translates the Netty Future to a CompletableFuture.
      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)
      Synchronizes promise and future in both directions.
      Type Parameters:
      T -
      Parameters:
      promise -
      future -