You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Opaque handle for manually controlling the publish acknowledgement for a received QoS 1 PUBLISH.
1236
+
1237
+
Obtained by calling acquire_publish_acknowledgement_control() within the on_publish_callback_fn callback.
1238
+
Pass to Client.invoke_publish_acknowledgement() to send the publish acknowledgement to the broker.
1239
+
"""
1240
+
1241
+
def__init__(self, control_id: int):
1242
+
self._control_id=control_id
1243
+
1244
+
1227
1245
@dataclass
1228
1246
classPublishReceivedData:
1229
1247
"""Dataclass containing data related to a Publish Received Callback
1230
1248
1231
1249
Args:
1232
1250
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.
1251
+
acquire_publish_acknowledgement_control (Callable): For QoS 1 messages only: call this function within the
1252
+
on_publish_callback_fn callback to take manual control of the publish acknowledgement for this message,
1253
+
preventing the client from automatically sending a publish acknowledgement. Returns a
1254
+
:class:`PublishAcknowledgementControlHandle` that can be passed to
1255
+
Client.invoke_publish_acknowledgement() to send the publish acknowledgement to the broker.
1256
+
1257
+
Important: This function must be called within the on_publish_callback_fn callback. Calling it after the
1258
+
callback returns will raise a RuntimeError. This function may only be called once per received PUBLISH;
1259
+
calling it a second time will also raise a RuntimeError. If this function is not called, the client will
1260
+
automatically send a publish acknowledgement for QoS 1 messages when the callback returns.
0 commit comments