fork download
  1. import asyncio
  2.  
  3. async def x():
  4. while True:
  5. await asyncio.sleep(0.3)
  6. print('oIo dick')
  7.  
  8. async def y():
  9. while True:
  10. await asyncio.sleep(1)
  11. print(')( cunt')
  12.  
  13. async def main():
  14. try:
  15. await asyncio.wait_for(asyncio.gather(x(), y()), timeout=4.5)
  16. except:
  17. print('timeout')
  18.  
  19. loop = asyncio.get_event_loop()
  20. loop.run_until_complete(main())
  21.  
  22.  
Success #stdin #stdout #stderr 0.08s 16124KB
stdin
Standard input is empty
stdout
oIo dick
oIo dick
oIo dick
)( cunt
oIo dick
oIo dick
oIo dick
)( cunt
oIo dick
oIo dick
oIo dick
)( cunt
oIo dick
oIo dick
oIo dick
oIo dick
)( cunt
oIo dick
timeout
stderr
_GatheringFuture exception was never retrieved
future: <_GatheringFuture finished exception=CancelledError()>
concurrent.futures._base.CancelledError