Class AsyncFunctions

    • Method Detail

      • asyncResultHandler

        public static <V,​E extends ExceptionAsyncFunction<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.