Async Iterators: a new future for streams
summary
Claims that async iterators can match or beat Node.js streams for throughput, with promise performance now good enough; demonstrates an uppercase transform and a CSV to JSON newline‑delimited pipeline built from async generator transforms and a small pipeline helper; measures bytes/sec and shows near‑identical or slightly higher throughput for iterators; surfaces real pitfalls that break correctness or perf—microtask starvation, for‑await consuming the whole source, and the need to throttle or use setImmediate for batching and HTTP/request iterators.
AI-written summary · about
chapters (14)
- 0:00Intro
- 0:31The basics
- 1:41Custom async iterators
- 2:50Node.js streams
- 4:08Stream transforms
- 5:38Now something more complex
- 8:14async-iterator-pipe
- 9:22HTTP servers
- 10:07How does http-iterator work?
- 10:31Pagination
- 13:56Batching
- 15:41For-await fully consumes
- 15:52Microtasks are higher priority
- 18:26Remember dezalgo?
related talks
25mAsync Iterators: A New Future for Streams
34mStream into the Future
33mStream into the Future
24mGenerating async iterators is ekstreamly easy, I Promise ;)
28mThe good, the bad and the ugly of nodejs streams
22mFrom Promises through Generators to async/await in node.js
24mAsync and Streaming JS - Are we doing it wrong?
28mWhat happens next: a choose-your-own-adventure with iterators
