Skip to content

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

@dharshan-webdev

Description

@dharshan-webdev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions