Level Up Your Java Streams with Gatherers, by Hinse ter Schuur

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

Java 24 introduced Stream Gatherers, a generic mechanism for custom intermediate stream operations. The talk covers the five built-in gatherers: windowFixed (fixed-size batching), windowSliding (moving window), scan (cumulative reduction emitting each step), fold (cumulative reduction emitting only the final value), and mapConcurrent (concurrent mapping with order preservation using virtual threads). A practical temperature-sensor data processing scenario motivates each example. The talk also walks through implementing a custom gatherer (zipWithIndex) using the Gatherer interface's initializer, integrator, and finisher components, and recommends starting with Gatherer.ofSequential before adding parallel combiner support.

44m watch time

Sort: