Package org.forgerock.openig.util
Class AsyncFunctions
- java.lang.Object
-
- org.forgerock.openig.util.AsyncFunctions
-
public final class AsyncFunctions extends Object
Collection ofAsyncFunctionutilities.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
Method Detail
-
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 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
asyncResultHandlerand return the original result.
-
-