IOT Dash
Public Member Functions | List of all members
IotDash.Services.Mqtt.Implementation.MqttNet_Subscriber Class Reference
Inheritance diagram for IotDash.Services.Mqtt.Implementation.MqttNet_Subscriber:
Inheritance graph
[legend]
Collaboration diagram for IotDash.Services.Mqtt.Implementation.MqttNet_Subscriber:
Collaboration graph
[legend]

Public Member Functions

 MqttNet_Subscriber (HostedMqttService serviceRoot, IServiceProvider provider)
 
Task Subscribe (string topic)
 
async Task Subscribe (IEnumerable< string > topics)
 
Task Unsubscribe (string topic)
 
async Task Unsubscribe (IEnumerable< string > topics)
 

Detailed Description

A component of the HostedMqttService. This class is responsible for maintaining list of subscribed topics synchronised with the MQTT broker, even in case of temporary disconnection.

Member Function Documentation

◆ Subscribe() [1/2]

async Task IotDash.Services.Mqtt.Implementation.MqttNet_Subscriber.Subscribe ( IEnumerable< string >  topics)
inline

Add topics to subscription list and potentially update with the broker.

Parameters
topicsList of the topic names.
Returns
Task that completes when the communication with broker is done.

◆ Subscribe() [2/2]

Task IotDash.Services.Mqtt.Implementation.MqttNet_Subscriber.Subscribe ( string  topic)

Add a topic to subscription list and potentially update with the broker.

Parameters
topicThe topic name.
Returns
Task that completes when the communication with broker is done.

◆ Unsubscribe() [1/2]

async Task IotDash.Services.Mqtt.Implementation.MqttNet_Subscriber.Unsubscribe ( IEnumerable< string >  topics)
inline

Remove topics from subscription list and potentially update with the broker.

Parameters
topicsList of the topics to remove.
Returns
Task that completes when the communication with broker is done.

◆ Unsubscribe() [2/2]

Task IotDash.Services.Mqtt.Implementation.MqttNet_Subscriber.Unsubscribe ( string  topic)

Remove a topic from subscription list and potentially update with the broker.

Parameters
topicThe topic to remove.
Returns
Task that completes when the communication with broker is done.

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