When running this code, it seems that I'm unable to open multiple simultaneous connections to the server. Maybe tornado is blocked on the asyncio.sleep()? Is this behaviour expected?
I've tested this on 5.0.1, 5.1 and master.
class MainHandler(tornado.web.RequestHandler):
async def get(self):
sleep = random.randrange(10)
logger.info('REQUEST will sleep for {}'.format(sleep))
await asyncio.sleep(sleep)
logger.info('woke up')
self.write('Ok')
def main():
logging_setup()
tornado.platform.asyncio.AsyncIOMainLoop().install()
application = tornado.web.Application([
(r"/", MainHandler),
])
application.listen(8000)
tornado.ioloop.IOLoop.current().start()
Are you using a browser? Take a look at the bottom of the FAQ page: http://www.tornadoweb.org/en/stable/faq.html
Most helpful comment
Are you using a browser? Take a look at the bottom of the FAQ page: http://www.tornadoweb.org/en/stable/faq.html