Skip to content

Tracking issue: Worker support #13143

Closed
Closed
@addaleax

Description

@addaleax

I’m opening this as a discussion issue, as proposed in #2133 (comment), to see whether and how we can get (Web)Worker support into Node core.

This feature would be comparatively large, there’s quite a bit of pre-existing work that we will want to look at, and I imagine we might want to do an enhancement proposal (EP) first to make sure we don’t engage in too much unnecessary work. I imagine the roadmap is something like this:

  1. Create a new repository in the org to work under, for code, working out the EP text, discussion issues, and so on. This is something I can just do unless anybody objects to that in the near future.
  2. Find volunteers who are willing to do parts of the work, maybe even set up somewhat regular meetings.
  3. See if there are any immediate objections to a feature of this kind becoming a part of Node core.
  4. Figure out what the API should look like; How close to the WebWorker standard could and should we get? How much of Node’s standard modules should be available to workers (e.g.: we’d probably want timers but no I/O modules? or maybe we would want those?)? SharedArrayBuffers? Other magic?
  5. Take a look at work that has been done elsewhere, e.g. workers: initial implementation #2133 or @audreyt’s https://github.com/audreyt/node-webworker-threads, and see how much can be used, what went well/not so well, etc.; Also, I know @bnoordhuis has looked into this a lot, so it would be really good to hear his thoughts.
  6. Write an EP based on discussion around those topics.
  7. Get the CTC to approve that EP.
  8. Work on the actual code, documentation, tests, etc. in that extra repository.
  9. Open a pull request against this repository (nodejs/node) with the new code.

I can probably lead a bit of the effort, and I’ve considered doing this work alone, but so far it always ended at “this would be too much work for me to do on my own”; so if you want to help, please do, but expect to spend some time on this. ❤️

/cc @nodejs/collaborators @petkaantonov @NawarA @pemrouz

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.workerIssues and PRs related to Worker support.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions