~/talk

CompletableFuture in Java 8, asynchronous processing done right

Talkat Joker 2015 · 2015-10-16..10-17· [java]
slides:none on file

Live coding shows how Java 8’s CompletableFuture replaces blocking threads with declarative pipelines: creating futures via supplyAsync using common ForkJoinPool (or with a passed Executor), chaining transforms with thenApply and thenCompose to avoid future‑of‑future, combining concurrency with thenCombine, applyToEither, allOf/anyOf (note allOf returns Void), and handling errors with handle/exceptionally. Also demonstrates promises via new CompletableFuture plus complete/completeExceptionally, and a timeout pattern built by racing a scheduled exceptional future against the real task.

AI-written summary · about

  1. 0:00Introduction to CompletableFuture
  2. 1:13Problem with blocking futures
  3. 3:40Introducing CompletableFuture
  4. 8:53Creating CompletableFuture instances
  5. 13:03Transforming futures with callbacks
  6. 19:03Chaining transformations
  7. 25:23Avoiding callback hell
  8. 27:48Building async pipelines
  9. 30:14Combining multiple futures
  10. 33:21Handling first completed future
  11. 34:02Waiting for all futures
  12. 36:08Handling exceptions in pipelines
  13. 41:22Error recovery with handle
  14. 48:33Creating futures manually
  15. 50:38Timeout patterns with futures
  16. 56:04Refactoring callback APIs
  17. 1:00:19Summary 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.