Tornado 4.5 Documentation
setup.py install, the following optional packages may be useful: concurrent.futures [https://pypi.python.org/pypi/futures] is the recommended thread pool for use with Tornado and enables the use of ThreadedResolver concurrency tornado.gen — Simplify asynchronous code tornado.concurrent — Work with threads and futures tornado.locks – Synchronization primitives tornado.queues – Queues for coroutines tornado.process 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. Error handling0 码力 | 333 页 | 322.34 KB | 1 年前3
Tornado 5.1 Documentation
in Tornado generally return placeholder objects (Futures), with the exception of some low-level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the coroutines have additional integration with the concurrent.futures [https://docs.python.org/3.6/library/concurrent.futures.html#module-concurrent.futures] package, allowing the result of executor.submit to be way to call a blocking function from a coroutine is to use IOLoop.run_in_executor, which returns Futures that are compatible with coroutines: async def call_blocking(): await IOLoop.current().run_in_executor(None0 码力 | 359 页 | 347.32 KB | 1 年前3
Tornado 6.0 Documentation
in Tornado generally return placeholder objects (Futures), with the exception of some low-level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the coroutines: have additional integration with the concurrent.futures [https://docs.python.org/3.6/library/concurrent.futures.html#module-concurrent.futures] package, allowing the result of executor.submit to be way to call a blocking function from a coroutine is to use IOLoop.run_in_executor, which returns Futures that are compatible with coroutines: async def call_blocking(): await IOLoop.current().run_in_executor(None0 码力 | 869 页 | 692.83 KB | 1 年前3
Tornado 6.1 Documentation
in Tornado generally return placeholder objects (Futures), with the exception of some low-level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the coroutines: have additional integration with the concurrent.futures [https://docs.python.org/3.6/library/concurrent.futures.html#module-concurrent.futures] package, allowing the result of executor.submit to be way to call a blocking function from a coroutine is to use IOLoop.run_in_executor, which returns Futures that are compatible with coroutines: async def call_blocking(): await IOLoop.current().run_in_executor(None0 码力 | 931 页 | 708.03 KB | 1 年前3
Tornado 6.2 Documentation
in Tornado generally return placeholder objects (Futures), with the exception of some low-level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the coroutines: have additional integration with the concurrent.futures [https://docs.python.org/3/library/concurrent.futures.html#module-concurrent.futures] package, allowing the result of executor.submit to be way to call a blocking function from a coroutine is to use IOLoop.run_in_executor, which returns Futures that are compatible with coroutines: async def call_blocking(): await IOLoop.current().run_in_executor(None0 码力 | 407 页 | 385.03 KB | 1 年前3
Tornado 6.4 Documentation
in Tornado generally return placeholder objects (Futures), with the exception of some low-level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the coroutines: have additional integration with the concurrent.futures [https://docs.python.org/3/library/concurrent.futures.html#module-concurrent.futures] package, allowing the result of executor.submit to be way to call a blocking function from a coroutine is to use IOLoop.run_in_executor, which returns Futures that are compatible with coroutines: async def call_blocking(): await IOLoop.current().run_in_executor(None0 码力 | 432 页 | 402.58 KB | 1 年前3
Tornado 6.4 Documentation
in Tornado generally return placeholder objects (Futures), with the exception of some low-level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the coroutines: have additional integration with the concurrent.futures [https://docs.python.org/3/library/concurrent.futures.html#module-concurrent.futures] package, allowing the result of executor.submit to be way to call a blocking function from a coroutine is to use IOLoop.run_in_executor, which returns Futures that are compatible with coroutines: async def call_blocking(): await IOLoop.current().run_in_executor(None0 码力 | 432 页 | 402.58 KB | 1 年前3
Tornado 6.4 Documentation
in Tornado generally return placeholder objects (Futures), with the exception of some low-level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the coroutines: have additional integration with the concurrent.futures [https://docs.python.org/3/library/concurrent.futures.html#module-concurrent.futures] package, allowing the result of executor.submit to be way to call a blocking function from a coroutine is to use IOLoop.run_in_executor, which returns Futures that are compatible with coroutines: async def call_blocking(): await IOLoop.current().run_in_executor(None0 码力 | 432 页 | 402.58 KB | 1 年前3
Tornado 6.3 Documentation
in Tornado generally return placeholder objects (Futures), with the exception of some low-level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the coroutines: have additional integration with the concurrent.futures [https://docs.python.org/3/library/concurrent.futures.html#module-concurrent.futures] package, allowing the result of executor.submit to be way to call a blocking function from a coroutine is to use IOLoop.run_in_executor, which returns Futures that are compatible with coroutines: async def call_blocking(): await IOLoop.current().run_in_executor(None0 码力 | 423 页 | 398.18 KB | 1 年前3
Tornado 4.5 Documentation
automatically by pip or setup.py install, the following optional packages may be useful: • concurrent.futures is the recommended thread pool for use with Tornado and enables the use of ThreadedResolver. It 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. Error handling exception (as opposed to the ad-hoc error handling common in callback-oriented interfaces), and Futures lend themselves well to use with coroutines. Coroutines will be discussed in depth in the next section0 码力 | 222 页 | 833.04 KB | 1 年前3
共 20 条
- 1
- 2













