eLabSDK2.Bootloader.RpcBroker

Single host-side message dispatcher shared across every AddonChannel. register(channel) installs the channel's incoming-message handler; on each inbound message the broker switches on type:

  • rpc — resolve the dotted method path against window.eLabSDK2 via the injected SdkMethodResolver, decode args (re-hydrating { __addonHandler } stubs into wrapper functions via HandlerInvoker), invoke, and post result / error back.
  • addon-error — surface a runtime error from the iframe (init throw, reinit throw, etc.) to the configured onAddonError reporter.
  • anything else — ignored.

The broker holds a WeakMap of channel → HandlerInvoker so each channel has exactly one invoker (handler ids are namespaced per channel). All inbound errors are caught and reported as addon-error events; the broker itself never throws to its caller.


© 2026 eLabNext