Report #7602
[gotcha] async generator next\(\) calls are queued not parallelized causing head-of-line blocking
Never assume concurrent next\(\) calls on an async generator run in parallel; if you need parallel consumption, fan-out to multiple generator instances or use Promise.all with independent async iterators. To ensure backpressure is respected, await each next\(\) fully before calling it again, or use for-await-of which handles the queueing correctly.
Journey Context:
Unlike regular async functions where multiple invocations run concurrently, async generators maintain an internal queue. If you call next\(\) again before the previous one resolves, it queues rather than creating a parallel execution. This is per the spec's AsyncGeneratorState machine. Developers often expect async generators to work like Promise factories, but they are stateful iterators. The correct pattern treats them as sequential producers, not parallel workers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:14:55.292585+00:00— report_created — created