OpenFin C++ Adapter 1.0.0

Loading...
Searching...
No Matches
OpenFinAdapterApi::ChannelProvider Class Reference

Represents a Channel Provider that accepts connections from Channel Clients. More...

#include <OpenFinAdapter.h>

Inheritance diagram for OpenFinAdapterApi::ChannelProvider:
OpenFinAdapterApi::MessageChannelClient

Public Member Functions

shared_future< void > openAsync ()
 Opens the Channel Provider, making it available for client connections.
 
void subscribeClientConnected (const function< void(const EndpointId &)> &listener)
 Registers a listener function that will be called upon client connections.
 
void unsubscribeClientConnected (const function< void(const EndpointId &)> &listener)
 Un-registers a listener from being called upon client connections.
 
void subscribeClientDisconnected (const function< void(const EndpointId &)> &listener)
 Registers a listener function that will be called upon client disconnections.
 
void unsubscribeClientDisconnected (const function< void(const EndpointId &)> &listener)
 Un-registers a listener from being called upon client disconnections.
 
shared_future< shared_ptr< string > > dispatchAsync (const EndpointId &targetChannel, const string &topic) const
 Dispatches an empty message to a remote endpoint on a topic.
 
shared_future< shared_ptr< string > > dispatchAsync (const EndpointId &targetChannel, const string &topic, const string &payloadJson) const
 Dispatches a payload to a remote endpoint on a topic.
 
shared_future< shared_ptr< string > > broadcastAsync (const string &topic, const string &payloadJson) const
 Dispatches a payload to all connected clients.
 
shared_future< shared_ptr< string > > broadcastAsync (const string &topic) const
 Dispatches an empty message to all connected clients on a topic.
 
- Public Member Functions inherited from OpenFinAdapterApi::MessageChannelClient
void registerTopic (const string &topic, const function< shared_ptr< string >(shared_ptr< string >, EndpointId)> &listener)
 Registers a listener of a topic.
 
void unregisterTopic (const string &topic)
 Unregisters a listener of a topic.
 

Detailed Description

Represents a Channel Provider that accepts connections from Channel Clients.

Member Function Documentation

◆ broadcastAsync() [1/2]

shared_future< shared_ptr< string > > OpenFinAdapterApi::ChannelProvider::broadcastAsync ( const string & topic) const

Dispatches an empty message to all connected clients on a topic.

Parameters
topicThe topic
Returns
An async future

◆ broadcastAsync() [2/2]

shared_future< shared_ptr< string > > OpenFinAdapterApi::ChannelProvider::broadcastAsync ( const string & topic,
const string & payloadJson ) const

Dispatches a payload to all connected clients.

Parameters
topicThe topic
payloadJsonThe payload
Returns
An async future

◆ dispatchAsync() [1/2]

shared_future< shared_ptr< string > > OpenFinAdapterApi::ChannelProvider::dispatchAsync ( const EndpointId & targetChannel,
const string & topic ) const

Dispatches an empty message to a remote endpoint on a topic.

Parameters
targetChannelThe target channel endpoint
topicThe topic
Returns
The response from the remote endpoint

◆ dispatchAsync() [2/2]

shared_future< shared_ptr< string > > OpenFinAdapterApi::ChannelProvider::dispatchAsync ( const EndpointId & targetChannel,
const string & topic,
const string & payloadJson ) const

Dispatches a payload to a remote endpoint on a topic.

Parameters
targetChannelThe target channel endpoint
topicThe topic
payloadJsonThe payload
Returns
The response from the remote endpoint

◆ openAsync()

shared_future< void > OpenFinAdapterApi::ChannelProvider::openAsync ( )

Opens the Channel Provider, making it available for client connections.

Returns
An async future that completes when the provider is open

◆ subscribeClientConnected()

void OpenFinAdapterApi::ChannelProvider::subscribeClientConnected ( const function< void(const EndpointId &)> & listener)

Registers a listener function that will be called upon client connections.

Parameters
listenerA listener

◆ subscribeClientDisconnected()

void OpenFinAdapterApi::ChannelProvider::subscribeClientDisconnected ( const function< void(const EndpointId &)> & listener)

Registers a listener function that will be called upon client disconnections.

Parameters
listenerA listener

◆ unsubscribeClientConnected()

void OpenFinAdapterApi::ChannelProvider::unsubscribeClientConnected ( const function< void(const EndpointId &)> & listener)

Un-registers a listener from being called upon client connections.

Parameters
listenerThe registered listener

◆ unsubscribeClientDisconnected()

void OpenFinAdapterApi::ChannelProvider::unsubscribeClientDisconnected ( const function< void(const EndpointId &)> & listener)

Un-registers a listener from being called upon client disconnections.

Parameters
listenerThe registered listener

The documentation for this class was generated from the following file: