Await tasks before stopping the session

This commit is contained in:
Dan 2018-06-17 18:34:10 +02:00
parent 2b0746a140
commit 6da15b266d

View File

@ -186,11 +186,11 @@ class Session:
self.connection.close() self.connection.close()
await self.recv_task if self.recv_task:
await self.recv_task
self.recv_queue.put_nowait(None) if self.net_worker_task:
await self.net_worker_task
await self.net_worker_task
for i in self.results.values(): for i in self.results.values():
i.event.set() i.event.set()