eLabSDK2.Bootloader.AddonChannel

Per-add-on MessagePort wrapper. One instance owns the host-side end of the
MessageChannel created by IframeFactory; the iframe-side end was transferred
during init. Responsibilities:

  • Outbound request(method, args) → assigns a request id, writes a
    pending entry, posts the message, returns a Promise that the
    RpcBroker (incoming-message handler) resolves or rejects on the
    matching result / error reply.
  • Outbound fire-and-forget send(msg) for messages without a reply
    (e.g. reinit, dispose-handlers).
  • Routing of inbound messages (port.onmessage) into a handler the
    RpcBroker installs via setIncomingHandler — so the broker is the
    single place where SDK calls and addon-error events are interpreted.
  • Disposal: close() rejects every pending request with AbortError,
    closes the port, and is idempotent.

© 2026 eLabNext