Daemonize input thread in chat demo

This commit is contained in:
Tony Garnock-Jones 2018-11-21 11:12:13 +00:00
parent 56fc179834
commit 1cccdcf99a
1 changed files with 1 additions and 1 deletions

View File

@ -55,6 +55,6 @@ def accept_input(loop):
conn.send(Says(me, line.strip()))
loop = asyncio.get_event_loop()
threading.Thread(target=lambda: accept_input(loop)).start()
threading.Thread(target=lambda: accept_input(loop), daemon=True).start()
loop.run_until_complete(reconnect(loop))
loop.close()