Episode 1 of 1 · 13:29
Async Generators: Streaming, Step by Step
What this episode covers
One answer from a RAG chatbot followed all the way to the screen: generators with yield and next(); async generators and for await; the server turning the model's stream into server-sent events with an async generator and a ReadableStream; the browser reading the response with three small async generators, for chunks, lines and tokens, and one for await loop; and why this shape gives work on demand and clean stopping. Animated diagrams show each yield, each await and each pause.
At the end: the whole path in TypeScript that you can run, with tests and a local demo.