Skip to content

docs: add Concurrency section comparing child_process, worker_threads, and cluster#110

Merged
avivkeller merged 9 commits into
nodejs:mainfrom
omscse:docs/add-concurrency-models-guide
Jul 4, 2026
Merged

docs: add Concurrency section comparing child_process, worker_threads, and cluster#110
avivkeller merged 9 commits into
nodejs:mainfrom
omscse:docs/add-concurrency-models-guide

Conversation

@omscse

@omscse omscse commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new Concurrency section to the Learn site with one article: Comparing Node.js concurrency models, covering child_process, worker_threads, and cluster side by side — comparison tables, runnable examples, and a decision guide for choosing between them.
  • Updates site.json sidebar navigation and the pages/index.md homepage list to include the new section.
  • Adds a row to CONTRIBUTING.md's section table.

Closes #109

Test plan

  • npm run lint — passes
  • npm run format:check — passes
  • npm run build — succeeds; verified generated HTML contains all expected headings and the homepage links to the new page

…, and cluster

Adds a new Learn article that compares Node.js's three built-in
concurrency mechanisms side by side, with examples and guidance on
when to reach for each one.
@omscse omscse requested a review from a team as a code owner July 4, 2026 00:49
@vercel

vercel Bot commented Jul 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-learn Ready Ready Preview Jul 4, 2026 8:25am

Request Review

@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Documentation-only changes with no runtime or application code affected.

Overview
Adds a new Concurrency learn section with the article Comparing Node.js concurrency models, which contrasts child_process, worker_threads, and cluster using comparison tables, CJS/MJS examples, and a when-to-use decision guide.

Navigation and contributor docs are updated so the section is discoverable: a Concurrency sidebar group in site.json, a homepage bullet in pages/index.md, and a concurrency/ row in CONTRIBUTING.md's section table.

Reviewed by Cursor Bugbot for commit 5aa3e63. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website

Please review the changes when you have a chance. Thank you! 🙏

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5695b86. Configure here.

Comment thread pages/concurrency/comparing-nodejs-concurrency-models.md
Addresses review feedback: the exit handler previously restarted a
worker unconditionally, which would also respawn workers during a
graceful shutdown (worker.disconnect()/cluster.disconnect()).
@omscse

omscse commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Good catch — fixed in 863218b: the exit handler now checks worker.exitedAfterDisconnect before respawning, and the surrounding text now explains why that check matters.

The three comparison tables used long full-sentence cells across 4-5
columns, making rows wider than the rest of the site's content and
forcing horizontal scrolling. Shortened cell content so tables fit
within the normal content width.
Tables without alignment markers in the separator row (plain --- vs
:---) were rendered by doc-kit without a text-align inline style on
th/td, unlike every other table in this repo. That missing style
appears to interact badly with the site's layout, causing the whole
content column (not just the table) to overflow horizontally instead
of wrapping. Matching the :--- convention used elsewhere fixes it.
The H1 was 82 characters, tied for the longest title in the repo.
Headings on this site use white-space:nowrap (for the anchor-link
icon layout), and a heading this long appears to force the whole
content column wider than the viewport instead of wrapping, which
explains why paragraphs and tables on this page overflowed
horizontally while every other page wraps normally. Shortened to
match the site's typical title length; the fuller description now
lives in the opening paragraph instead.
Comment thread pages/concurrency/comparing-nodejs-concurrency-models.md Outdated
Comment thread pages/concurrency/comparing-nodejs-concurrency-models.md Outdated
Comment thread pages/concurrency/comparing-nodejs-concurrency-models.md Outdated
Co-authored-by: Aviv Keller <me@aviv.sh>
Signed-off-by: Omprakash Selvaraj <cse.omprakash@gmail.com>
omscse and others added 2 commits July 4, 2026 04:04
Co-authored-by: Aviv Keller <me@aviv.sh>
Signed-off-by: Omprakash Selvaraj <cse.omprakash@gmail.com>
Co-authored-by: Aviv Keller <me@aviv.sh>
Signed-off-by: Omprakash Selvaraj <cse.omprakash@gmail.com>

@AugustinMauroy AugustinMauroy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT !

@avivkeller avivkeller added this pull request to the merge queue Jul 4, 2026
Merged via the queue into nodejs:main with commit b19929c Jul 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a "Concurrency" section covering child_process, worker_threads, and cluster

3 participants