andywer / andywer/threads.js

Support for worker-to-worker communication

Open
#169 4 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
3.5k
Forks
173
PR merge metrics
No merged PRs in 30d

Description

Allow exposing a worker's functionality to other workers using [MessageChannel](https://developer.mozilla.org/en-US/docs/Web/API/MessageChannel).

Workers must handle a new meta message transferring a pair of message ports and listen on it / send to it, too, not just the main thread.

# To Do

- Allow communication using arbitrary MessagePort instances
- Allow passing a MessagePort to spawn() (maybe rather create a new function)
- Add Thread.isTerminatable()
- Export MessageChannel & MessagePort

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.