CompletionStage.whenCompleteAsync

Returns a new CompletionStage that, when this stage completes either normally or exceptionally, is executed using the supplied executor, 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 executor the executor to use for asynchronous execution @param (U) the function's return type @return the new CompletionStage

Meta