summaryrefslogtreecommitdiff
path: root/docs/getting_started/sendlogout.rst
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-01-27 00:10:15 +0100
committermathieui <mathieui@mathieui.net>2021-01-27 00:16:56 +0100
commit51866f0d46a932f2b720bc876eb4bef50cfb277d (patch)
tree0d191cd7f9f47101fa2fb835760651bf5dee736e /docs/getting_started/sendlogout.rst
parent9390794401f438e93ac39805b77bcca05d5a3e47 (diff)
downloadslixmpp-51866f0d46a932f2b720bc876eb4bef50cfb277d.tar.gz
slixmpp-51866f0d46a932f2b720bc876eb4bef50cfb277d.tar.bz2
slixmpp-51866f0d46a932f2b720bc876eb4bef50cfb277d.tar.xz
slixmpp-51866f0d46a932f2b720bc876eb4bef50cfb277d.zip
docs: update the tutorials a bit
Diffstat (limited to 'docs/getting_started/sendlogout.rst')
-rw-r--r--docs/getting_started/sendlogout.rst14
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/getting_started/sendlogout.rst b/docs/getting_started/sendlogout.rst
index 3b5d6d5a..defbf278 100644
--- a/docs/getting_started/sendlogout.rst
+++ b/docs/getting_started/sendlogout.rst
@@ -31,23 +31,23 @@ for the JID that will receive our message, and the string content of the message
self.add_event_handler('session_start', self.start)
- def start(self, event):
+ async def start(self, event):
self.send_presence()
- self.get_roster()
+ await self.get_roster()
Note that as in :ref:`echobot`, we need to include send an initial presence and request
the roster. Next, we want to send our message, and to do that we will use :meth:`send_message <slixmpp.basexmpp.BaseXMPP.send_message>`.
.. code-block:: python
- def start(self, event):
+ async def start(self, event):
self.send_presence()
- self.get_roster()
+ await self.get_roster()
self.send_message(mto=self.recipient, mbody=self.msg)
Finally, we need to disconnect the client using :meth:`disconnect <slixmpp.xmlstream.XMLStream.disconnect>`.
-Now, sent stanzas are placed in a queue to pass them to the send thread.
+Now, sent stanzas are placed in a queue to pass them to the send routine.
:meth:`disconnect <slixmpp.xmlstream.XMLStream.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
@@ -55,9 +55,9 @@ the `wait` parameter. If `0.0` is passed for `wait`, :meth:`disconnect
.. code-block:: python
- def start(self, event):
+ async def start(self, event):
self.send_presence()
- self.get_roster()
+ await self.get_roster()
self.send_message(mto=self.recipient, mbody=self.msg)