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
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
In java-9 the new method completeOnTimeout in the CompletableFuture class was introduced: public CompletableFuture<T> completeOnTimeout(T value, long time
To allow multiple iterations on the resulting stream from a CompletableFuture<Stream<String>> I am considering one of the following approaches: Con
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&