~/talk

Hunting with Stream Gatherers

Talkat Devoxx Belgium 2024 · 2024-10-07..10-11· [java, frontend-architecture]
links:none on file
slides:none on file

Java adds an intermediate-operation extension point in preview (Stream Gatherers in Java 22/23) that can keep state, emit zero-or-many outputs, short-circuit and run concurrently. The demo builds a unique-by-length gatherer and an n‑gram gatherer (initializer, integrator, combiner, finisher) that replace collect-then-postprocess patterns and avoid mapping every element. Using mapConcurrent with virtual threads runs 100 blocking tasks in ~1s versus ~9s on a 12‑core ForkJoin parallel run, and the custom gatherers work as shown.

AI-written summary · about

  1. 0:00Introduction to Streams
  2. 5:55Streams Evolution
  3. 8:50Challenges in Stream API
  4. 15:35Introducing Stream Gatherers
  5. 18:43Implementing a Gatherer
  6. 22:37Formal Gatherer Definition
  7. 26:10Built-in Gatherers
  8. 27:35Solving Blocking I/O
  9. 33:36Gatherer Examples
  10. 37:38Observability and N-grams
  11. 44:30Conclusion
~/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.