stream: keep overlapping broadcast reads pending · nodejs/node@97ef13c · GitHub
Skip to content

Commit 97ef13c

Browse files
trivikraduh95
authored andcommitted
stream: keep overlapping broadcast reads pending
Broadcast consumers may receive overlapping next() calls on the same iterator. Queue those reads so chunks satisfy them in call order. A single written chunk should resolve the earliest pending next(); later next() calls remain pending until more data is written or the broadcast completes. Fixes: #63499 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63500 Backport-PR-URL: #64675 Fixes: #63499 Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent a46ddad commit 97ef13c

2 files changed

Lines changed: 90 additions & 4 deletions

File tree

lib/internal/streams/iter/broadcast.js

Lines changed: 56 additions & 4 deletions

test/parallel/test-stream-iter-broadcast-basic.js

Lines changed: 34 additions & 0 deletions

0 commit comments

Comments
 (0)