In which thread does CompletableFuture's completion handlers execute in?
I have a question about CompletableFuture method: public <U> CompletableFuture<U> thenApply(Function<? super T, ? extends U> fn) The thing is the JavaDoc says just this: Returns a new CompletionStage that, when this stage completes normally, is executed with this stage's result as the argument to the supplied function. See the CompletionStage documentation for rules covering exceptional completion. What about threading? In which thread this is going to be executed? What if the future is completed by a thread pool? The policies as specified in the CompletableFuture docs could help you