fork download
  1. import asyncio
  2.  
  3.  
  4. @asyncio.coroutine
  5. def root():
  6. queue = asyncio.Queue()
  7.  
  8. @asyncio.coroutine
  9. def inner():
  10. yield from queue.put("ping")
  11. asyncio.async(inner())
  12.  
  13. msg = yield from queue.get()
  14. print(msg)
  15.  
  16. asyncio.get_event_loop().run_until_complete(root())
  17.  
Success #stdin #stdout 0.12s 14312KB
stdin
Standard input is empty
stdout
ping