Channel
The class Channel
represents an individual named channel within the data pipeline. It is used to track subscribers and to publish messages when there are subscribers present. It exists as a separate object to avoid channel lookups at publish time, enabling very fast publish speeds and allowing for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly with new Channel(name)
is not supported.
Since
v15.1.0, v14.17.0
Properties
Functions
When channel.runStores(context, ...)
is called, the given context data will be applied to any store bound to the channel. If the store has already been bound the previous transform
function will be replaced with the new one. The transform
function may be omitted to set the given context data as the context directly.
Register a message handler to subscribe to this channel. This message handler will be run synchronously whenever a message is published to the channel. Any errors thrown in the message handler will trigger an 'uncaughtException'
.
Remove a message handler previously registered to this channel with channel.bindStore(store)
.
Remove a message handler previously registered to this channel with channel.subscribe(onMessage)
.