~/talk

Each All the Way Down: How Ruby Enumerators Power Streaming...

Talkat RubyConf 2026 · 2026-07-14..07-16· [ruby, web-performance]
links:none on file
slides:none on file

Explains why gRPC Ruby requires an Enumerator rather than just any Enumerable: gRPC calls each with a block to start network sends so returning an Array forces full materialization (imagine buffering a billion items) and delays streaming, while an enumerator delays execution and enables external iteration and backpressure. Shows concrete code patterns: custom each, enum_for / enumerator_new, how server and client streams map to the same enumerator contract over HTTP/2 and Protocol Buffers, and that the approach works for interleaved production and consumption.

AI-written summary · about

  1. 0:00Introduction
  2. 1:25RPCs and gRPC explained
  3. 3:51gRPC streaming patterns
  4. 5:19gRPC Ruby streaming code
  5. 7:47Simplified gRPC example
  6. 8:48Ruby Enumerable module
  7. 11:57Ruby enumerators matter
  8. 12:59Internal vs external iteration
  9. 16:32gRPC needs server enumerator
  10. 19:48Arrays vs enumerators test
  11. 21:56No block case handling
  12. 22:17Client side stream consuming
  13. 24:46gRPC Ruby iteration patterns
  14. 26:55Summary
~/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.