About 50 results
Open links in new tab
  1. java - ExecutorService vs CompletableFuture - Stack Overflow

    Sep 13, 2018 · CompletableFuture.supplyAsync(() -> MyFileService.service3(); } I understand that that CompletableFuture is new from Java 8, but how is the 2nd code better than the 1st? Since, for …

  2. Spring Boot @Async annotation and CompletableFuture

    Feb 5, 2026 · Returns a new CompletableFuture that is asynchronously completed by a task running in the ForkJoinPool.commonPool () with the value obtained by calling the given Supplier. If you want a …

  3. CompletableFuture<T> class: join () vs get () - Stack Overflow

    The part about exceptionally() is a bit distracting because it isn't relevant, as exceptionally(…) can be used with either get() or with join(). Perhaps you were trying to add additional commentary that …

  4. Spring @Async with CompletableFuture - Stack Overflow

    CompletableFuture<User> future = CompletableFuture.runAsync(() -> doFoo(), myExecutor); And all of your exceptionally logic you would do with the returned CompletableFuture from that method.

  5. Java 8 CompletableFuture.allOf(...) with Collection or List

    Mar 5, 2016 · Java 8 has a function CompletableFuture.allOf(CompletableFuture<?>...cfs) that returns a CompletableFuture that is completed when all the given futures complete. However, I almost always …

  6. Transform Java Future into a CompletableFuture - Stack Overflow

    Apr 26, 2014 · Java 8 introduces CompletableFuture, a new implementation of Future that is composable (includes a bunch of thenXxx methods). I'd like to use this exclusively, but many of the …

  7. java - Return CompletableFuture<Void> or ... - Stack Overflow

    Dec 12, 2015 · For example: CompletableFuture.allOf, the passed list might be a CompletableFuture originated from a Runnable, so we can't get the result. Having said all of that, …

  8. What is the recommended way to wait till the Completable future …

    Jun 8, 2015 · I am using CompletableFuture as shown below in the code. But concerning the way I should wait till all runnables finish, I found two ways and I do not know the difference between them …

  9. java - CompletableFuture from Callable? - Stack Overflow

    May 31, 2015 · Today I experimented with the "new" CompletableFuture from Java 8 and found myself confused when I didn't find a runAsync(Callable) method. I can do it myself like shown below, but …

  10. When is CompletableFuture actually completed? - Stack Overflow

    Jun 16, 2015 · It will return a CompletableFuture of its own that will be completed when all the CompletableFuture you gave them are done. You chain that into another CompletableFuture with …