~/talk

Stream Gatherers

Talkat JCON EUROPE 2025 · 2025-05-12..05-15· [java, compilers-and-language-design]
slides:none on file

Stream gatherers, now in JDK 24 via the JEPs mentioned, let you implement real intermediate operations by supplying an initializer integrator finisher trio so you can create map, filter, limit/skip, indexed streams, a flexible distinctBy, sliding-window and grouped operations that the Stream API lacked. Demos show a working indexed counter, a distinct-last implemented with a finisher, sliding-window with remainder handled in finisher, and a mapConcurrent option; implementations must check the downstream push boolean to support short‑circuiting and parallel use.

AI-written summary · about

  1. 0:00Introduction to Stream Gatherers
  2. 1:38JDK releases and JEP 461
  3. 2:39Stream operations recap
  4. 4:25Thinking experiment without operations
  5. 5:26Basic Stream Gatherer implementation
  6. 7:11Simple gatherer example
  7. 8:15Implementing a mapper gatherer
  8. 8:57Mapping objects with gatherers
  9. 9:40Filtering with gatherers
  10. 11:04Stateless vs stateful gatherers
  11. 11:25Stateful operations with gatherers
  12. 13:52Implementing limit and skip
  13. 14:14Take while and drop while
  14. 17:07Creating an indexed stream
  15. 19:40Custom index implementations
  16. 21:02Distinct operation with gatherers
  17. 23:33Finisher in gatherers
  18. 24:57Distinct last implementation
  19. 26:03Distinct by classifier
  20. 27:06Sliding window statistics
  21. 30:58Fixed window size handling
  22. 32:42Finisher for incomplete windows
  23. 33:44Execution frequency of gatherers
  24. 35:13Downstream rejection handling
  25. 37:43Checking downstream signals
  26. 38:47Map concurrent gatherer
  27. 40:13Scan and fold operations
  28. 41:17Windowed operations in JDK
  29. 42:21Parallel stream gatherers
  30. 43:25Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.