Class AsyncFunctions

java.lang.Object
org.forgerock.openig.util.AsyncFunctions

public final class AsyncFunctions extends Object
Collection of AsyncFunction utilities.
  • Method Details

    • asyncResultHandler

      public static <V, E extends Exception> AsyncFunction<V,V,E> asyncResultHandler(AsyncFunction<V,Void,E> asyncResultHandler)
      Utility async function that will allow to use the calling promise's result asynchronously. This allows to write thenAsync(asyncResultHandler(result -> { ...do some async processing with result...}).then(...) which the async version of thenOnResult(result -> { ... }).then(...).
      Type Parameters:
      V - The type of the result
      E - The type of the exception
      Parameters:
      asyncResultHandler - The handler that will use the calling promise's result
      Returns:
      An AsyncFunction that will execute the given asyncResultHandler and return the original result.