This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import random | |
| @asyncio.coroutine | |
| def print_whenever(identifier): | |
| """a little function that prints at random intervals""" | |
| while True: | |
| yield from asyncio.sleep(random.choice([0.5, 1, 1.3])) | |
| print('hi from', identifier) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import tornado.concurrent | |
| import tornado.ioloop | |
| import tornado.web | |
| import tornado.platform.asyncio | |
| import tornado.httpclient | |
| class ReqHandler(tornado.web.RequestHandler): | |
| async def get(self): |