About 433,000 results
Open links in new tab
  1. 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 …

  2. 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 …

  3. spring - Thread vs Runnable vs CompletableFuture in Java multi ...

    Jan 5, 2023 · As far as I see, I can use Thread, Runnable or CompletableFuture in order to implement multi threading in a Java app. CompletableFuture seems a newer and cleaner way, but Thread may …

  4. java - Return a CompletableFuture containing a list of ...

    Nov 29, 2019 · By the way, the equivalent of flatMap for completableFuture is thenCompose() which takes a function that takes the element returned by the Future as an input and must returns another …

  5. java - Difference between CompletableFuture, Future and RxJava's ...

    Feb 11, 2016 · Java's CompletableFuture is innovated by Scala's Future. It carries an internal callback method. Once it is finished, the callback method will be triggered and tell the thread that the …

  6. 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.

  7. java - CompletableFuture in loop: How to collect all responses and ...

    Jul 2, 2018 · I am trying to call a rest api for PUT request in a loop. Each call is a CompletableFuture. Each api call returns an object of type RoomTypes.RoomType I want to collect the responses (both …

  8. 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 …

  9. How to interrupt underlying execution of CompletableFuture

    Mar 12, 2015 · 42 I know that CompletableFuture design does not control its execution with interruptions, but I suppose some of you might have this problem. CompletableFuture s are very …

  10. CompletableFuture, supplyAsync () and thenApply () - Stack Overflow

    CompletableFuture .supplyAsync(() -> { A a = doSomethingAndReturnA(); convertToB(a); }); Right? Furthermore, another two questions following as for "is there any reason why we would use …