~/talk

CompletableFuture and its Quirks

Talkat Devoxx Poland 2022 · 2022-06-22..06-24· [java]
slides:none on file

CompletableFuture has four practical surprises: cancellation doesn't stop work — cancel() marks the CF but doesn't reliably interrupt the threads actually doing the work; allOf/anyOf treat exceptions like values — allOf returns Void and waits for every completion (no short‑circuit), anyOf can return an exceptional result if it completes first; default async uses the common ForkJoinPool so code can run on unexpected threads (even main) unless an explicit Executor is supplied; applyToEither can prefer an exception over a successful result depending on completion order.

AI-written summary · about

  1. 0:00Introduction to futures
  2. 1:54Synchronous vs asynchronous
  3. 3:53Java future limitations
  4. 6:08Handling exceptions
  5. 8:07Combining futures
  6. 9:43CompletableFuture basics
  7. 12:32Cancellation quirks
  8. 17:31Understanding AllOf method
  9. 23:54Fixing AllOf method
  10. 26:49Understanding AnyOf method
  11. 30:20Thread management
  12. 36:58ForkJoinPool risks
  13. 44:03Conclusion and Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.