denoland / denoland/std

Request: Web Workers Library

Open
#6,260 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

Web Workers are the main way to do parallel computing in Deno, but the API is very low-level. Libraries like [Comlink](https://github.com/GoogleChromeLabs/comlink) exist, which I have been using in basically all my Deno projects, but I think an official solution from Deno would go a long way.

**Describe the solution you'd like**

I like @negrel's solution of first creating an [RPC layer](https://github.com/negrel/rpc) to handle the request-response pattern, and then building [other stuff on top of that](https://github.com/negrel/workerpool). If even just the RPC layer were added to std, it would be a good first step towards building a highly flexible system for dealing with web workers. It's still pretty low-level, but not so low-level that you need to build the RPC from scratch every time you want to use workers.

**Describe alternatives you've considered**

If left up to the community, I think people will just continue to complain forever that JavaScript is bad at parallelization. Which is true, but a lot can be done still to improve it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.