Java 8's CompletableFuture.allOf(CompletableFuture<?>...cfs)
will return a CompletableFuture
that is completed when all the given futures complete, or throws a CompletionException
if one of the futures completes with an exception.
If one of my futures completes with an exception, will CompletableFuture.allOf
wait for the remaining futures to complete before throwing the CompletionException
or will it cancel the remaining futures?
If it waits for all futures to complete, it there any way to make it return immediately when any future throws an exception and cancel the remaining futures?