Tornado 6.1 Documentation
officially supported or recommended for production use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports my_future = Future() fetch_future = http_client.fetch(url) def on_fetch(f): my_future.set_result(f.result().body) fetch_future.add_done_callback(on_fetch) return my_future Notice that support some shorthand for waiting on multiple objects by yielding a list or dict. Use tornado.gen.multi to do this in native coroutines. can support integration with other packages including Twisted via0 码力 | 931 页 | 708.03 KB | 1 年前3
Tornado 6.0 Documentation
compatible with Tornado. Applications that use Tornado on Windows with Python 3.8 must call asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) at the beginning of their main file/function my_future = Future() fetch_future = http_client.fetch(url) def on_fetch(f): my_future.set_result(f.result().body) fetch_future.add_done_callback(on_fetch) return my_future Notice that support some shorthand for waiting on multiple objects by yielding a list or dict. Use tornado.gen.multi to do this in native coroutines. can support integration with other packages including Twisted via0 码力 | 869 页 | 692.83 KB | 1 年前3
Tornado 5.1 Documentation
AsyncHTTPClient() my_future = Future() fetch_future = http_client.fetch(url) def on_fetch(f): my_future.set_result(f.result().body) fetch_future.add_done_callback(on_fetch) return my_future Notice that the support some shorthand for waiting on multiple objects by yielding a list or dict. Use tornado.gen.multi to do this in native coroutines. • Decorated coroutines can support integration with other packages blocking_func, args) Parallelism The multi function accepts lists and dicts whose values are Futures, and waits for all of those Futures in parallel: from tornado.gen import multi async def parallel_fetch(url10 码力 | 243 页 | 895.80 KB | 1 年前3
Tornado 6.1 Documentation
officially supported or recommended for pro- duction use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports AsyncHTTPClient() my_future = Future() fetch_future = http_client.fetch(url) def on_fetch(f): my_future.set_result(f.result().body) fetch_future.add_done_callback(on_fetch) return my_future Notice that the support some shorthand for waiting on multiple objects by yielding a list or dict. Use tornado.gen. multi to do this in native coroutines. – can support integration with other packages including Twisted0 码力 | 245 页 | 904.24 KB | 1 年前3
Tornado 6.0 Documentation
compatible with Tornado. Applications that use Tornado on Windows with Python 3.8 must call asyncio.set_event_loop_policy(asyncio. WindowsSelectorEventLoopPolicy()) at the beginning of their main file/function AsyncHTTPClient() my_future = Future() fetch_future = http_client.fetch(url) def on_fetch(f): my_future.set_result(f.result().body) fetch_future.add_done_callback(on_fetch) return my_future Notice that the support some shorthand for waiting on multiple objects by yielding a list or dict. Use tornado.gen. multi to do this in native coroutines. – can support integration with other packages including Twisted0 码力 | 245 页 | 885.76 KB | 1 年前3
Tornado 4.5 Documentation
Future() fetch_future = http_client.fetch(url) fetch_future.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 you can yield a list of Futures, while in a native coroutine you must wrap the list in tornado.gen.multi. This also eliminates the integration with concurrent.futures. You can use tornado.gen.convert_yielded that yields Queue.get pauses until there is an item in the queue. If the queue has a maximum size set, a coroutine that yields Queue.put pauses until there is room for another item. A Queue maintains0 码力 | 222 页 | 833.04 KB | 1 年前3
Tornado 4.5 Documentation
fetch_future = http_client.fetch(url) fetch_future.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 you can yield a list of Futures, while in a native coroutine you must wrap the list in tornado.gen.multi. This also eliminates the integration with concurrent.futures [https://docs.python.org/3.5/library/concurrent that yields Queue.get pauses until there is an item in the queue. If the queue has a maximum size set, a coroutine that yields Queue.put pauses until there is room for another item. A Queue maintains0 码力 | 333 页 | 322.34 KB | 1 年前3
Tornado 5.1 Documentation
my_future = Future() fetch_future = http_client.fetch(url) def on_fetch(f): my_future.set_result(f.result().body) fetch_future.add_done_callback(on_fetch) return my_future Notice that support some shorthand for waiting on multiple objects by yielding a list or dict. Use tornado.gen.multi to do this in native coroutines. Decorated coroutines can support integration with other packages blocking_func, args) Parallelism The multi function accepts lists and dicts whose values are Futures, and waits for all of those Futures in parallel: from tornado.gen import multi async def parallel_fetch(url10 码力 | 359 页 | 347.32 KB | 1 年前3
Tornado 6.5 Documentationofficially supported or recommended for pro- duction use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports AsyncHTTPClient() my_future = Future() fetch_future = http_client.fetch(url) def on_fetch(f): my_future.set_result(f.result().body) fetch_future.add_done_callback(on_fetch) return my_future Notice that the support some shorthand for waiting on multiple objects by yielding a list or dict. Use tornado.gen.multi to do this in native coroutines. – can support integration with other packages including Twisted0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 6.2 Documentation
officially supported or recommended for pro- duction use. Some features are missing on Windows (including multi-process mode) and scalability is limited (Even though Tornado is built on asyncio, which supports AsyncHTTPClient() my_future = Future() fetch_future = http_client.fetch(url) def on_fetch(f): my_future.set_result(f.result().body) fetch_future.add_done_callback(on_fetch) return my_future Notice that the support some shorthand for waiting on multiple objects by yielding a list or dict. Use tornado.gen.multi to do this in native coroutines. – can support integration with other packages including Twisted0 码力 | 260 页 | 1.06 MB | 1 年前3
共 20 条
- 1
- 2













