typescript
8 minTypeScript async iterators: connect pull-based demand to resource cleanup
Use for-await consumption, cancellation, and iterator return semantics without hiding queues.
Loading page...
typescript
8 minUse for-await consumption, cancellation, and iterator return semantics without hiding queues.
Q&A
Q&ANo; an adapter can hide an unbounded push queue behind a pull-shaped interface.
A consumer can request one item at a time, but callback-backed sources still need an explicit capacity and overflow policy. Tie early iterator exit and cancellation to resource cleanup.