andywer / andywer/threads.js

Support for worker-to-worker communication

Aperta
#169 4 commenti 3 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
TypeScript
Stelle
3.5k
Fork
173
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.