Keynote: Where Promises Fall Short
summary
Java’s CompletableFuture behaves like JavaScript promises and works fine for happy paths but becomes awkward for error handling: the demo shows a simple “double even numbers” pipeline that breaks into nulls or type juggling when an exception occurs and requires use of exceptionally (and returned recovery values) to continue. Streams and CompletableFuture adapt between sync and async at runtime. Replacing OS threads with virtual threads changes one line, removes thread-per-wait blocking in a file I/O example, and scales far better. Java 8 introduced these APIs; Loom lands in Java 21 LTS.
AI-written summary · about
chapters (14)
- 0:00Java concurrency trends
- 2:34Parallel vs concurrent execution
- 4:42Synchronous vs async communication
- 7:49Multi-threaded imperative challenges
- 10:19Java 8 streams & parallelism
- 12:49Non-blocking execution analogy
- 16:02Java threads for I/O tasks
- 17:54CompletableFuture vs JavaScript promises
- 22:16Promises fall short in errors
- 29:40Async pipeline exceptions
- 35:42Functional vs imperative trade-offs
- 37:07Thread usage in blocking I/O
- 41:27Virtual threads & lightweight execution
- 43:56Java 21’s async model
related talks
48mCompletableFuture: The Promises of Java
02h 35mParallel and Asynchronous Programming with Streams and CompletableFuture
50mThinkAsync in Java8
28mBack to the CompletableFuture: Concurrency
49mConcurrency and Streaming in the Age of Loom
48mParallel Streams, CompletableFuture, and All That: Concurrency in Java 8
01h 01mMultithreading vs Asynchronous Programming: The Architectural Shift
47mConcurrent and Asynchronous Programming: Loom in Java 20 and 21
