Skip to content

doc: clarify forEach concurrency and ordering - #66291

Open
mmustafasenoglu wants to merge 1 commit into
nodejs:mainfrom
mmustafasenoglu:doc/stream-foreach-blocking-note
Open

mmustafasenoglu wants to merge 1 commit into
nodejs:mainfrom
mmustafasenoglu:doc/stream-foreach-blocking-note

Conversation

@mmustafasenoglu

Copy link
Copy Markdown

Adds a short note to the readable.forEach docs for #66106, explaining that with concurrency greater than 1 the fn calls still complete in chunk order, so a slow call on an early chunk holds up the later ones.

Fixes: #66106

Disclosure: I used an AI coding assistant to help draft this docs change. I personally verified the wording against the implementation in lib/internal/streams/operators.js (forEach delegates to map, which awaits the queued calls in order) and confirmed the behavior with a local script.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to Node.js documentation. stream Issues and PRs related to Node.js streams. labels Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

Caution

AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context.

Signed-off-by: Mustafa Senoglu <mmustafasenoglu0@gmail.com>
@mmustafasenoglu
mmustafasenoglu force-pushed the doc/stream-foreach-blocking-note branch from 6ad2df7 to 5b56ec8 Compare September 25, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentscan:mixed-signals doc Issues and PRs related to Node.js documentation. stream Issues and PRs related to Node.js streams.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stream.prototype.forEach will block in first promise in queue before read more chunk

2 participants