CompletionStage.handleAsync

Returns a new CompletionStage that, when this stage completes either normally or exceptionally, is executed using this stage's default asynchronous execution facility, with this stage's result and exception as arguments to the supplied function.

<p>When this stage is complete, the given function is invoked with the result (or {@code null} if none) and the exception (or {@code null} if none) of this stage as arguments, and the function's result is used to complete the returned stage.

@param fn the function to use to compute the value of the returned CompletionStage @param (U) the function's return type @return the new CompletionStage

  1. CompletionStage!(U) handleAsync(BiFunction!(T, Throwable, U) fn)
    interface CompletionStage(T)
    handleAsync
    (
    U
    )
    (
    BiFunction!(T, Throwable, U) fn
    )
  2. CompletionStage!(U) handleAsync(BiFunction!(T, Throwable, U) fn, Executor executor)

Meta