Stream Gatherers - Deep Dive with the Expert
summary
Announces a concrete API, JEP 485, added as final in Java 24: java.util.stream.Gatherers that lets users write true intermediate stream operations instead of fake workarounds. Demonstrates working implementations for map, mapMulti, limit, scan, fixed-size windows and mapConcurrent, shows how sequential vs parallel evaluation and short‑circuiting are handled, and how gatherers compose. Explains runtime model (initializer → integrator → finisher → downstream), parallel tree splitting and cancellation, and confirms the design runs and supports stateful, stateless, frugal and composable transforms.
AI-written summary · about
chapters (15)
- 0:00Intro
- 0:22Java Stream Anatomy
- 2:03Intermediate Stream Operation?
- 2:28Growing an API
- 9:08Evaluating Collector against the requirements
- 10:29Stream Gatherers
- 12:37Gatherers vs. Collectors
- 15:20Example - Stream::map as a Gatherer
- 17:20Example - Stream::mapMulti as a Gatherer
- 18:08Example - Stream::limit as a Gatherer
- 21:21Sequential vs. Parallel Evaluation
- 29:16Some of the available java.util.stream.Gatherers
- 33:25A note on composition
- 35:44Conclusions
- 36:45Q&A
related talks
40mStream Gathers - The biggest change to Java Streams since 10 years
45mStream Gatherers
52mThe Gatherer API: the tool that was missing in the Stream API
46mJEP 461: Breathing New Life into Java Stream API
44mLevel Up Your Java Streams with Gatherers
48mWe Are All Gathered — We Are All to Gather
45mHunting with Stream Gatherers
51mHunting with Stream Gatherers
