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 againstwindow.eLabSDK2via the injectedSdkMethodResolver, decode args (re-hydrating{ __addonHandler }stubs into wrapper functions via HandlerInvoker), invoke, and postresult/errorback.addon-error— surface a runtime error from the iframe (init throw, reinit throw, etc.) to the configuredonAddonErrorreporter.- 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
Updated about 16 hours ago