Top "Completable-future" questions

In Java 8, a Future that may be explicitly completed (setting its value and status), and may include dependent functions and actions that trigger upon its completion.

ExecutorService.submit(Task) vs CompletableFuture.supplyAsync(Task, Executor)

To run some stuff in parallel or asynchronously I can use either an ExecutorService: <T> Future<T&…

java concurrency future completable-future
CompletableFuture in loop: How to collect all responses and handle errors

I am trying to call a rest api for PUT request in a loop. Each call is a CompletableFuture. Each …

java multithreading asynchronous java-8 completable-future
Spring @Async with CompletableFuture

I have a doubt about this code: @Async public CompletableFuture<String> doFoo() { CompletableFuture<String> fooFuture = new …

spring completable-future
Difference between thenAccept and thenApply

I'm reading the document on CompletableFuture and The description for thenAccept() is Returns a new CompletionStage that, when this stage …

java asynchronous java-8 completable-future
How to cancel Java 8 completable future?

I am playing with Java 8 completable futures. I have the following code: CountDownLatch waitLatch = new CountDownLatch(1); CompletableFuture<?> future = …

java multithreading java-8 completable-future
What is the difference between thenApply and thenApplyAsync of Java CompletableFuture?

Suppose I have the following code: CompletableFuture<Integer> future = CompletableFuture.supplyAsync( () -> 0); thenApply case: future.thenApply( x …

java completable-future
Java 8 Supplier Exception handling with CompletableFuture

Consider the following code public class TestCompletableFuture { BiConsumer<Integer, Throwable> biConsumer = (x,y) -> { System.out.println(…

java exception java-8 completable-future
Chaining several CompletionStage only if a condition is achieved

I have several CompletionStage methods that I'd like to chain. The problem is that the result of the first one …

java-8 completable-future
How to interrupt underlying execution of CompletableFuture

I know that CompletableFuture design does not control its execution with interruptions, but I suppose some of you might have …

java concurrency completable-future
CompletableFuture chaining results

I am trying to chain the calls/results of the methods to the next call. I get compile time error …

java java-8 completable-future