Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def task1():
- await asyncio.sleep(3)
- print("after sleep")
- async def task2():
- t = loop.create_task(task1())
- await asyncio.sleep(1)
- t.cancel()
- # can the following code lines assume that task1 is no longer running?
- loop = asyncio.get_event_loop()
- loop.run_forever()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement