Skip to content

Commit

Permalink
Update wait_for_publish() documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Aug 26, 2021
1 parent 0c2ac47 commit 550da7d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/paho/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,17 @@ def _set_as_published(self):
self._condition.notify()

def wait_for_publish(self, timeout=None):
"""Block until the message associated with this object is published."""
"""Block until the message associated with this object is published, or
until the timeout occurs. If timeout is None, this will never time out.
Set timeout to a positive number of seconds, e.g. 1.2, to enable the
timeout.
Raises ValueError if the message was not queued due to the outgoing
queue being full.
Raises RuntimeError if the message was not published for another
reason.
"""
if self.rc == MQTT_ERR_QUEUE_SIZE:
raise ValueError('Message is not queued due to ERR_QUEUE_SIZE')
elif self.rc == MQTT_ERR_AGAIN:
Expand Down

0 comments on commit 550da7d

Please sign in to comment.