|
kmMqtt 0.0.1
MQTT Client Library
|
Options for configuring the MQTT client behavior. More...
#include <MqttClientOptions.h>
Public Member Functions | |
| MqttClientOptions & | tickMode (TickMode mode) |
| Set the tick mode for the MQTT client. | |
| MqttClientOptions & | callbackDispatcher (const std::shared_ptr< ICallbackDispatcher > &callbackDispatcher) |
| Set a custom callback dispatcher for handling MQTT client callbacks. | |
| TickMode | getTickMode () const |
| Get the current tick mode of the MQTT client. | |
| std::shared_ptr< ICallbackDispatcher > | getCallbackDispatcher () const |
| Get the current callback dispatcher used by the MQTT client. | |
| bool | isUsingInternalCallbackDeferrer () const |
| Check if the internal callback deferrer is being used. | |
Options for configuring the MQTT client behavior.
|
inline |
Set a custom callback dispatcher for handling MQTT client callbacks.
Works with both async and sync tick modes. If no dispatcher is provided, the default dispatcher will be used.
In ASYNC tick mode, if DefaultDispatcher is provided or no dispatcher is provided, ImmediateDispatcher will be used instead.
In SYNC tick mode, if DefaultDispatcher is provided or no dispatcher is provided, DefaultDispatcher will be used which is dependent on the user calling tick() to process callbacks.
| callbackDispatcher | The custom callback dispatcher to use. |
|
inline |
Get the current callback dispatcher used by the MQTT client.
|
inline |
Get the current tick mode of the MQTT client.
|
inline |
Check if the internal callback deferrer is being used.
|
inline |
Set the tick mode for the MQTT client.
The tick mode determines how the client processes incoming messages and events. The ASYNC mode runs the tick function in a separate thread, while the SYNC mode requires the user to call the tick function manually in their application loop.
| mode | The desired tick mode (ASYNC or SYNC). Default is ASYNC. |