openStream()
The following API is built on top of sendMessage
and onMessage
, basically, it's just a wrapper, the routing and security rules still apply the same way.
Opens a Stream
between caller and destination.
Returns a Promise
which resolves with Stream
when the destination is ready (loaded and onOpenStreamChannel
callback registered).
channel
Required | string
Stream
(s) are strictly scoped sendMessage
(s). Scopes could be different features of your extension that need to talk to the other side, and those scopes are named using a channel id.
destination
Required | string
Same as destination
in sendMessage(msgId, data, destination)