Single Threaded
You can call both asynchronous (async) and synchronous (sync) APIs without any special precautions.
Multi-threaded
All distinct objects are not thread-safe. To access shared client
and/or endpoint
objects, construct them with a strand-wrapped executor for the underlying layer’s argument. The async_*
member functions of client
and endpoint
will dispatch to the executor. As a result of the strand’s effect, your asynchronous processes will be serialized.
The following synchronous member functions are accessed directly. Therefore, you need to introduce locks or explicitly dispatch to the executor.
endpoint member function | effects |
---|---|
Acquire the new unique packet_id |
|
Register the packet_id |
|
Release the packet_id |
|
Get already PUBLISH recv CompletionToken is invoked packet_ids |
|
Restore already PUBLISH recv CompletionToken is invoked packet_ids |
|
Restore pacets as stored packets |
|
Get stored packets |
|
Get MQTT protocol version |
client member function | effects |
---|---|
Acquire the new unique packet_id |
|
Register the packet_id |
|
Release the packet_id |