Skip to content

fix(ext/node): add threadName to worker_threads module#32072

Merged
bartlomieju merged 2 commits intodenoland:mainfrom
bartlomieju:node_worker_
Feb 9, 2026
Merged

fix(ext/node): add threadName to worker_threads module#32072
bartlomieju merged 2 commits intodenoland:mainfrom
bartlomieju:node_worker_

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Summary

Adds the threadName export and Worker.threadName getter to the worker_threads module for Node.js compatibility.

  • threadName module export: returns the name of the current thread (empty string for main thread, worker's name inside a worker)
  • Worker.threadName getter: returns the worker's name while running, null after the worker has exited

Test plan

  • cargo test --test node_compat parallel -- --filter test-worker-thread-name

🤖 Generated with Claude Code

Adds the `threadName` export and `Worker.threadName` getter to the
worker_threads module for Node.js compatibility.

- `threadName` module export: returns the name of the current thread
  (empty string for main thread, worker's name inside a worker)
- `Worker.threadName` getter: returns the worker's name while running,
  `null` after the worker has exited

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bartlomieju bartlomieju merged commit db748af into denoland:main Feb 9, 2026
21 checks passed
@bartlomieju bartlomieju deleted the node_worker_ branch February 9, 2026 10:48
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.

2 participants