From 4435c81d77c651a20bfe979ed8d20f9887c057d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 24 Apr 2019 23:22:45 +0100 Subject: xmlstream.disconnect: add compat behaviour, set wait to default `2.0` when True is passed. Update documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- docs/getting_started/sendlogout.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/getting_started') diff --git a/docs/getting_started/sendlogout.rst b/docs/getting_started/sendlogout.rst index a27976c5..3b5d6d5a 100644 --- a/docs/getting_started/sendlogout.rst +++ b/docs/getting_started/sendlogout.rst @@ -47,11 +47,11 @@ the roster. Next, we want to send our message, and to do that we will use :meth: self.send_message(mto=self.recipient, mbody=self.msg) Finally, we need to disconnect the client using :meth:`disconnect `. -Now, sent stanzas are placed in a queue to pass them to the send thread. If we were to call -:meth:`disconnect ` without any parameters, then it is possible -for the client to disconnect before the send queue is processed and the message is actually -sent on the wire. To ensure that our message is processed, we use -:meth:`disconnect(wait=True) `. +Now, sent stanzas are placed in a queue to pass them to the send thread. +:meth:`disconnect ` by default will wait for an +acknowledgement from the server for at least `2.0` seconds. This time is configurable with +the `wait` parameter. If `0.0` is passed for `wait`, :meth:`disconnect +` will not close the connection gracefully. .. code-block:: python @@ -61,12 +61,12 @@ sent on the wire. To ensure that our message is processed, we use self.send_message(mto=self.recipient, mbody=self.msg) - self.disconnect(wait=True) + self.disconnect() .. warning:: If you happen to be adding stanzas to the send queue faster than the send thread - can process them, then :meth:`disconnect(wait=True) ` + can process them, then :meth:`disconnect() ` will block and not disconnect. Final Product -- cgit v1.2.3