Deep Dive into Gatherers - JEP Cafe #24

This JEP Café takes you through everything you can do with Gatherers, added to JDK 24 and available in JDK 25, the version you are going to use for your business applications. Along with many examples, it shows you the basics of mapping and filtering, how you can create and manage an internal mutable state to limit your stream, and sort them. It shows you how you can properly interrupt a stream when you need, and how you can avoid resource leaking and race conditions in the use of the API. It also shows you how you can leverage some available optimizations by declaring your integrators greedy when you can. One of the greatest features of the Stream API is that you can decide to go parallel. So parallel Gatherers are covered, along with the use of non-parallel Gatherers in parallel streams. At the end of this video you will know eveything you need to write efficient and correct Gatherers, but also when you should use them, and when you should stay away from them.

Make sure to check the show-notes!