stream: cache minimum cursor count in broadcast · nodejs/node@1d7c86d · GitHub
Skip to content

Commit 1d7c86d

Browse files
trivikraduh95
authored andcommitted
stream: cache minimum cursor count in broadcast
Track how many broadcast consumers share the cached minimum cursor, matching the share implementation. This lets buffer trimming avoid calling getMinCursor() until the last minimum-cursor consumer advances or detaches. Add coverage for fan-out trimming behavior. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63322 Backport-PR-URL: #64675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
1 parent ec2666e commit 1d7c86d

2 files changed

Lines changed: 74 additions & 20 deletions

File tree

lib/internal/streams/iter/broadcast.js

Lines changed: 46 additions & 20 deletions

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

Lines changed: 28 additions & 0 deletions

0 commit comments

Comments
 (0)