Category "completable-future"

Which ExecutorService is best for blocking IO tasks

Let's imagine that we have n independent blocking IO tasks e.g. tasks for rest-call to another server. Then all answer we need to combine. Every task can be pro

finally block equivalent for exception handling in CompletableFuture

I have CompletableFuture which can return result or exception. I want to perform run some common code in case of exception and normal result. Similar to try cat

static ScheduledThreadPoolExecutor in CompletableFuture.Delayer

In java-9 the new method completeOnTimeout in the CompletableFuture class was introduced: public CompletableFuture<T> completeOnTimeout(T value, long time

Is it correct to convert a CompletableFuture<Stream<T>> to a Publisher<T>?

To allow multiple iterations on the resulting stream from a CompletableFuture<Stream<String>> I am considering one of the following approaches: Con

CompletableFuture | thenApply vs thenCompose

I can't get my head around the difference between thenApply and thenCompose. So, could someone provide a valid use case? From the Java docs: thenApply(Function&