Tornado 6.5 Documentation
Application([ (r"/", MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s ASYNCIO INTEGRATION Tornado is integrated with the standard library asyncio module and shares the same event loop (by default since Tornado 5.0). In general, libraries designed for use with asyncio can be mixed be very expensive. To minimize the cost of concurrent connections, Tornado uses a single-threaded event loop. This means that all appli- cation code should aim to be asynchronous and non-blocking because0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait()if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s asyncio [https://docs.python.org/3/library/asyncio.html#module-asyncio] module and shares the same event loop (by default since Tornado 5.0). In general, libraries designed for use with asyncio [https://docs http1connection – HTTP/1.x client/server implementation Asynchronous networking tornado.ioloop — Main event loop tornado.iostream — Convenient wrappers for non-blocking socketstornado.netutil — Miscellaneous0 码力 | 437 页 | 405.14 KB | 2 月前3
共 2 条
- 1
相关搜索词