Tornado 4.5 Documentation
http1connection – HTTP/1.x client/server implementation Asynchronous networking tornado.ioloop — Main event loop tornado.iostream — Convenient wrappers for non-blocking sockets tornado.netutil — Miscellaneous be very expensive. To minimize the cost of concurrent connections, Tornado uses a single-threaded event loop. This means that all application code should aim to be asynchronous and non-blocking because lambda f: my_future.set_result(f.result())) return my_future The raw Future version is more complex, but Futures are nonetheless recommended practice in Tornado because they have two major advantages0 码力 | 333 页 | 322.34 KB | 1 年前3
Tornado 4.5 Documentation
Documentation, Release 4.5.3 To minimize the cost of concurrent connections, Tornado uses a single-threaded event loop. This means that all application code should aim to be asynchronous and non-blocking because add_done_callback( lambda f: my_future.set_result(f.result())) return my_future The raw Future version is more complex, but Futures are nonetheless recommended practice in Tornado because they have two major advantages as fetch_future = tornado.gen.convert_yielded(self.fetch_next_chunk()) to start the background processing. Looping Looping is tricky with coroutines since there is no way in Python to yield on every0 码力 | 222 页 | 833.04 KB | 1 年前3
Tornado 6.5 DocumentationApplication([ (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 | 3 月前3
Tornado 6.4 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 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 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 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 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 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.3 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 码力 | 264 页 | 1.06 MB | 1 年前3
Tornado 6.1 Documentation
asyncio [https://docs.python.org/3.6/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 sockets tornado.netutil — Miscellaneous be very expensive. To minimize the cost of concurrent connections, Tornado uses a single-threaded event loop. This means that all application code should aim to be asynchronous and non-blocking because0 码力 | 931 页 | 708.03 KB | 1 年前3
Tornado 6.0 Documentation
asyncio [https://docs.python.org/3.6/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 older, but Python 3.8 defaults to an event loop that is not compatible with Tornado. Applications that use Tornado on Windows with Python 3.8 must call asyncio.set_event_loop_policy(asyncio.WindowsSelect http1connection – HTTP/1.x client/server implementation Asynchronous networking tornado.ioloop — Main event loop tornado.iostream — Convenient wrappers for non-blocking sockets tornado.netutil — Miscellaneous0 码力 | 869 页 | 692.83 KB | 1 年前3
Tornado 6.5 DocumentationMainHandler), ]) 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 | 3 月前3
共 20 条
- 1
- 2













