Namespace: Channel

InterApplicationBus. Channel

The Channel namespace allows an OpenFin application to create a channel as a ChannelProvider, or connect to a channel as a ChannelClient (see Classes below). The "handshake" between the communication partners is simplified when using a channel. A request to connect to a channel as a client will return a promise that resolves if/when the channel has been created. Both the provider and client can dispatch actions that have been registered on their opposites, and dispatch returns a promise that resolves with a payload from the other communication participant. There can be only one provider per channel, but many clients. Version 9.61.35.* or later is required for both communication partners.

Synchronous Methods
Asynchronous Methods

Methods

(static) connect(channelName, options) → {Promise.<Channel#ChannelClient>}

Connect to a channel. Returns a promise for a ChannelClient instance for that channel. If you wish to send a payload to the provider, add a payload property to the options argument.

Parameters:
Name Type Description
channelName string

Name of the target channel.

options Channel~ConnectOptions

Connection options.

Tutorials:
Returns:

Returns promise that resolves with an instance of ChannelClient.

Type
Promise.<Channel#ChannelClient>

(static) create(channelName) → {Promise.<Channel#ChannelProvider>}

Create a new channel. Returns a promise that resolves with a ChannelProvider instance for your channel. You must provide a unique channelName. If a channelName is not provided, or it is not unique, the creation will fail.

Parameters:
Name Type Description
channelName string

Name of the channel to be created.

Tutorials:
Returns:

Returns promise that resolves with an instance of ChannelProvider.

Type
Promise.<Channel#ChannelProvider>

(static) onChannelConnect(listener)

Listen for newly created channels.

Parameters:
Name Type Description
listener Channel~ConnectionEvent

callback to execute.

Tutorials:
  • Tutorial: channel.onChannelConnect

(static) onChannelDisconnect(listener)

Listen for channel disconnections.

Parameters:
Name Type Description
listener Channel~ConnectionEvent

callback to execute.

Tutorials:
  • Tutorial: channel.onChannelDisconnect