Returns a new CompletionStage that is completed with the same
value as the CompletionStage returned by the given function,
executed using the supplied Executor.
<p>When this stage completes normally, the given function is
invoked with this stage's result as the argument, returning
another CompletionStage. When that stage completes normally,
the CompletionStage returned by this method is completed with
the same value.
<p>To ensure progress, the supplied function must arrange
eventual completion of its result.
<p>See the {@link CompletionStage} documentation for rules
covering exceptional completion.
@param fn the function to use to compute another CompletionStage
@param executor the executor to use for asynchronous execution
@param (U) the type of the returned CompletionStage's result
@return the new CompletionStage
Returns a new CompletionStage that is completed with the same value as the CompletionStage returned by the given function, executed using the supplied Executor.
<p>When this stage completes normally, the given function is invoked with this stage's result as the argument, returning another CompletionStage. When that stage completes normally, the CompletionStage returned by this method is completed with the same value.
<p>To ensure progress, the supplied function must arrange eventual completion of its result.
<p>See the {@link CompletionStage} documentation for rules covering exceptional completion.
@param fn the function to use to compute another CompletionStage @param executor the executor to use for asynchronous execution @param (U) the type of the returned CompletionStage's result @return the new CompletionStage