summaryrefslogtreecommitdiff
path: root/slixmpp/xmlstream
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2018-10-09 12:34:56 +0200
committermathieui <mathieui@mathieui.net>2018-10-09 12:34:56 +0200
commit809c50000204f8724bac80cb3359a690fdbc839e (patch)
tree6212494e366fd6fc6138993bca86df67f70717e7 /slixmpp/xmlstream
parentdda4e18b810e5f76bca78c80dfb8a3d32e4b5bcf (diff)
downloadslixmpp-809c50000204f8724bac80cb3359a690fdbc839e.tar.gz
slixmpp-809c50000204f8724bac80cb3359a690fdbc839e.tar.bz2
slixmpp-809c50000204f8724bac80cb3359a690fdbc839e.tar.xz
slixmpp-809c50000204f8724bac80cb3359a690fdbc839e.zip
Add the loop parameters at places where it has been forgotten
Diffstat (limited to 'slixmpp/xmlstream')
-rw-r--r--slixmpp/xmlstream/xmlstream.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index 0367db02..0e6ac5a3 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -285,7 +285,10 @@ class XMLStream(asyncio.BaseProtocol):
self.disable_starttls = disable_starttls
self.event("connecting")
- self._current_connection_attempt = asyncio.ensure_future(self._connect_routine())
+ self._current_connection_attempt = asyncio.ensure_future(
+ self._connect_routine(),
+ loop=self.loop,
+ )
async def _connect_routine(self):
self.event_when_connected = "connected"
@@ -306,7 +309,7 @@ class XMLStream(asyncio.BaseProtocol):
else:
ssl_context = None
- await asyncio.sleep(self.connect_loop_wait)
+ await asyncio.sleep(self.connect_loop_wait, loop=self.loop)
try:
await self.loop.create_connection(lambda: self,
self.address[0],
@@ -321,7 +324,10 @@ class XMLStream(asyncio.BaseProtocol):
log.debug('Connection failed: %s', e)
self.event("connection_failed", e)
self.connect_loop_wait = self.connect_loop_wait * 2 + 1
- self._current_connection_attempt = asyncio.ensure_future(self._connect_routine())
+ self._current_connection_attempt = asyncio.ensure_future(
+ self._connect_routine(),
+ loop=self.loop,
+ )
def process(self, *, forever=True, timeout=None):
"""Process all the available XMPP events (receiving or sending data on the
@@ -336,10 +342,10 @@ class XMLStream(asyncio.BaseProtocol):
else:
self.loop.run_until_complete(self.disconnected)
else:
- tasks = [asyncio.sleep(timeout)]
+ tasks = [asyncio.sleep(timeout, loop=self.loop)]
if not forever:
tasks.append(self.disconnected)
- self.loop.run_until_complete(asyncio.wait(tasks))
+ self.loop.run_until_complete(asyncio.wait(tasks, loop=self.loop))
def init_parser(self):
"""init the XML parser. The parser must always be reset for each new
@@ -781,7 +787,10 @@ class XMLStream(asyncio.BaseProtocol):
old_exception(e)
else:
self.exception(e)
- asyncio.ensure_future(handler_callback_routine(handler_callback))
+ asyncio.ensure_future(
+ handler_callback_routine(handler_callback),
+ loop=self.loop,
+ )
else:
try:
handler_callback(data)