FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

worker: add postMessageToThread by ShogunPanda · Pull Request #53682 · nodejs/node · GitHub

/ node Public

worker: add postMessageToThread - #53682

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
ShogunPanda:send-to-worker
Jul 9, 2024
Merged

worker: add postMessageToThread#53682
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
ShogunPanda:send-to-worker

Conversation

ShogunPanda commented Jul 2, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

This PR is a total rethinking of #53488.

This PR adds a new API to worker_threads called postMessageToThread that allow to send arbitrary messages to any worker thread just identifying it by its threadId.

The recipient thread must have a listener on the new workerMessage event emitted on process otherwise the postMessageToThread will throw an exception.

In order not to have any thread block, the call is async to use Atomics.waitAsync.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. semver-minor PRs that contain new features and should be released in the next minor version. worker Issues and PRs related to Worker support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL