-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
worker: motivating examples? #33880
Copy link
Copy link
Closed
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.questionIssues that look for answers.Issues that look for answers.workerIssues and PRs related to Worker support.Issues and PRs related to Worker support.
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.questionIssues that look for answers.Issues that look for answers.workerIssues and PRs related to Worker support.Issues and PRs related to Worker support.
I'm having a hard time figuring out when I would actually want to use workers over a child process.
The docs provide the following motivation:
However, I'm having a hard time finding a case where I would actually use this. Usually I would have either strings or objects that I would like to pass onto a worker. Maybe something like https://capnproto.org/ could take advantage of this? But from what I can see such approaches are actually quite slow in javascript.
Also, from what I understand actually transferring Buffers to workers have some edge cases and could fallback to become a copy.
I'm not saying it's a bad feature. I would really love to try it out and use it. I'm just having trouble finding the use case for it.
Maybe someone could provide some ideas/examples of when this would be useful would be helpful as a point of inspiration?