Change session_start callback to async in most examples

If we fetch the roster, we should probably wait until we get it back
This commit is contained in:
mathieui
2020-05-02 16:47:04 +02:00
parent e520ab1f5e
commit f1ab9ab964
19 changed files with 33 additions and 37 deletions

View File

@@ -51,12 +51,8 @@ class RosterBrowser(slixmpp.ClientXMPP):
event does not provide any additional
data.
"""
future = asyncio.Future()
def callback(result):
future.set_result(None)
try:
self.get_roster(callback=callback)
await future
await self.get_roster()
except IqError as err:
print('Error: %s' % err.iq['error']['condition'])
except IqTimeout: