From 51866f0d46a932f2b720bc876eb4bef50cfb277d Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 27 Jan 2021 00:10:15 +0100 Subject: docs: update the tutorials a bit --- docs/getting_started/sendlogout.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/getting_started/sendlogout.rst') 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 `. .. 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 `. -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 ` 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) -- cgit v1.2.3