Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for worker-to-worker communication #169

Open
andywer opened this issue Oct 5, 2019 · 4 comments
Open

Support for worker-to-worker communication #169

andywer opened this issue Oct 5, 2019 · 4 comments

Comments

@andywer
Copy link
Owner

andywer commented Oct 5, 2019

Allow exposing a worker's functionality to other workers using 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
@hyusetiawan
Copy link

any update on this? would love to leverage MessageChannel for worker to worker support, bypassing the main thread

@andywer
Copy link
Owner Author

andywer commented Apr 18, 2020

Haven't found time to work on that yet, but it's good to know that there is interest in that 👍

@linonetwo
Copy link

Seems currently we can manually pass in MessageChannel as options, to setup communication between two workers?

@trasherdk
Copy link

@linonetwo Do you have a code snippet demonstrating communication between two workers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants