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

Explicitly mention in the document of Comlink's limitation on bidirectional communication between main thread and worker #672

Open
dharshan-webdev opened this issue Nov 6, 2024 · 0 comments

Comments

@dharshan-webdev
Copy link

There appears to be a fundamental limitation when attempting to use Comlink to enable bidirectional communication between the main thread and a worker thread simultaneously. Current behavior suggests that Comlink only supports unidirectional communication effectively, meaning that either the main thread can expose and the worker can consume, or vice versa, but not both ways at once. Explicit guidance on this in the documentation could help avoid confusion and save time troubleshooting.

Expected Outcome:
It would be beneficial if the documentation could explicitly mention:

  1. Why Comlink does not support simultaneous bidirectional exposure (main ⇄ worker).
  2. Any underlying technical constraints, such as those related to structured cloning or transferables, that impact this behavior.
  3. Workarounds or best practices for developers needing two-way interaction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant