Skip to content

Commit d872ccb

Browse files
committed
comments
1 parent 1c380bf commit d872ccb

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

awscrt/mqtt5.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ class PublishReceivedData:
12281228
12291229
Args:
12301230
publish_packet (PublishPacket): Data model of an `MQTT5 PUBLISH <https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901100>`_ packet.
1231-
acquire_puback_control (Callable): Call this function to prevent automatic PUBACK and take manual control of this PUBLISH message's PUBACK. Returns an opaque handle object that can be passed to Client.invoke_puback().
1231+
acquire_puback_control (Callable): Acquires manual control over the PUBACK for this QoS 1 PUBLISH message, preventing the client from automatically sending a PUBACK. The returned handle can be passed to invoke_puback() to send the PUBACK to the broker. This method MUST be called within the message received callback.
12321232
"""
12331233
publish_packet: PublishPacket = None
12341234
acquire_puback_control: Callable = None
@@ -1965,7 +1965,10 @@ def get_stats(self):
19651965
return OperationStatisticsData(result[0], result[1], result[2], result[3])
19661966

19671967
def invoke_puback(self, puback_control_handle):
1968-
"""Sends a PUBACK packet for the given puback control handle.
1968+
"""Sends a PUBACK packet for a QoS 1 PUBLISH that was previously acquired for manual control.
1969+
To use manual PUBACK control, call acquire_puback_control() within the on_publish_callback_fn
1970+
callback to obtain an opaque handle object. Then call this method with the opaque handle object
1971+
to send the PUBACK.
19691972
19701973
Args:
19711974
puback_control_handle: An opaque handle obtained from acquire_puback_control(). This handle cannot be created manually and must come from the acquire_puback_control() Callable within PublishReceivedData.

source/mqtt5_client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ static PyObject *s_aws_set_user_properties_to_PyObject(
220220

221221
static const char *s_capsule_name_puback_control_handle = "aws_puback_control_handle";
222222

223+
/* An opaque handle representing manual control over a QoS 1 PUBACK for a received PUBLISH packet. */
223224
struct puback_control_handle {
224225
uint64_t control_id;
225226
};

0 commit comments

Comments
 (0)