Skip to content

Commit 550da7d

Browse files
committed
Update wait_for_publish() documentation.
1 parent 0c2ac47 commit 550da7d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/paho/mqtt/client.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,17 @@ def _set_as_published(self):
337337
self._condition.notify()
338338

339339
def wait_for_publish(self, timeout=None):
340-
"""Block until the message associated with this object is published."""
340+
"""Block until the message associated with this object is published, or
341+
until the timeout occurs. If timeout is None, this will never time out.
342+
Set timeout to a positive number of seconds, e.g. 1.2, to enable the
343+
timeout.
344+
345+
Raises ValueError if the message was not queued due to the outgoing
346+
queue being full.
347+
348+
Raises RuntimeError if the message was not published for another
349+
reason.
350+
"""
341351
if self.rc == MQTT_ERR_QUEUE_SIZE:
342352
raise ValueError('Message is not queued due to ERR_QUEUE_SIZE')
343353
elif self.rc == MQTT_ERR_AGAIN:

0 commit comments

Comments
 (0)