~/talk

Async Iterators: A New Future for Streams

Talkat Node+JS Interactive 2019 · 2019-12-11..12-12· [nodejs, frontend-architecture]
slides:none on file

Async iterators replace complicated Node streams with concise generator-style code that can read a file, split lines, parse CSV and produce newline-delimited JSON in ~50 lines, implement a pipeline/pipe that accepts async generators, build an HTTP request channel surfer as an async iterator, and batch items by manually calling next. Performance testing shows async iterators about 15% faster and using 40% less memory for a CSV→NDJSON example, but watch out for for-await fully consumes and microtask-priority pitfalls requiring an extra await or setImmediate.

AI-written summary · about

  1. 0:00Intro
  2. 1:47Streams
  3. 4:01parsing
  4. 6:40handling streams
  5. 7:51HTTP servers
  6. 11:49Batching
  7. 13:41Yield
  8. 14:59Pitfalls
  9. 17:39Desalgo
  10. 19:22Performance Demo
~/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.