1
0

network: fix some threading issues

This commit is contained in:
SomberNight
2018-09-20 21:07:31 +02:00
parent 1294608571
commit 3be5b4b00f
2 changed files with 18 additions and 15 deletions

View File

@@ -369,8 +369,10 @@ class Interface(PrintError):
await self.session.send_request('server.ping')
def close(self):
self.fut.cancel()
asyncio.get_event_loop().create_task(self.group.cancel_remaining())
async def job():
self.fut.cancel()
await self.group.cancel_remaining()
asyncio.run_coroutine_threadsafe(job(), self.network.asyncio_loop)
async def run_fetch_blocks(self):
header_queue = asyncio.Queue()