Package org.forgerock.openig.util
Class AsyncFunctions
java.lang.Object
org.forgerock.openig.util.AsyncFunctions
Collection of
AsyncFunction
utilities.-
Method Summary
Modifier and TypeMethodDescriptionstatic <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.
-
Method Details
-
asyncResultHandler
public static <V,E extends Exception> AsyncFunction<V,V, asyncResultHandlerE> (AsyncFunction<V, Void, E> asyncResultHandler) Utility async function that will allow to use the calling promise's result asynchronously. This allows to writethenAsync(asyncResultHandler(result -> { ...do some async processing with result...}).then(...)
which the async version ofthenOnResult(result -> { ... }).then(...)
.- Type Parameters:
V
- The type of the resultE
- 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.
-