Tornado 4.5 Documentation
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. It is needed only on Python 2; Python returns Futures that are compatible with coroutines: thread_pool = ThreadPoolExecutor(4) @gen.coroutine def call_blocking(): yield thread_pool.submit(blocking_func, args) Parallelism The coroutine decorator standard library since Python 3.2, installable with pip install futures in older versions). The thread pool size can be configured with: Resolver.configure('tornado.netutil.ThreadedResolver',0 码力 | 333 页 | 322.34 KB | 1 年前3
Tornado 4.5 Documentation
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 is needed only on Python 2; Python returns Futures that are compatible with coroutines: thread_pool = ThreadPoolExecutor(4) @gen.coroutine def call_blocking(): yield thread_pool.submit(blocking_func, args) Parallelism The coroutine decorator The thread pool size can be configured with: Resolver.configure('tornado.netutil.ThreadedResolver', num_threads=10) Changed in version 3.1: All ThreadedResolvers share a single thread pool, whose size0 码力 | 222 页 | 833.04 KB | 1 年前3
Tornado 6.4 Documentation
The thread pool size can be configured with: Resolver.configure('tornado.netutil.ThreadedResolver', num_threads=10) Changed in version 3.1: All ThreadedResolvers share a single thread pool, whose size application will run on the event loop thread in Tornado 6.3; this will change to use an internal thread pool by default in Tornado 7.0. Warning: By default, the WSGI application is executed on the event loop’s application on the event loop thread is deprecated and will change in Tornado 7.0 to use a thread pool by default. environ(request: HTTPServerRequest) → Dict[str, Any] Converts a tornado.httputil.HTTPServerRequest0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
The thread pool size can be configured with: Resolver.configure('tornado.netutil.ThreadedResolver', num_threads=10) Changed in version 3.1: All ThreadedResolvers share a single thread pool, whose size application will run on the event loop thread in Tornado 6.3; this will change to use an internal thread pool by default in Tornado 7.0. Warning: By default, the WSGI application is executed on the event loop’s application on the event loop thread is deprecated and will change in Tornado 7.0 to use a thread pool by default. environ(request: HTTPServerRequest) → Dict[str, Any] Converts a tornado.httputil.HTTPServerRequest0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.4 Documentation
The thread pool size can be configured with: Resolver.configure('tornado.netutil.ThreadedResolver', num_threads=10) Changed in version 3.1: All ThreadedResolvers share a single thread pool, whose size application will run on the event loop thread in Tornado 6.3; this will change to use an internal thread pool by default in Tornado 7.0. Warning: By default, the WSGI application is executed on the event loop’s application on the event loop thread is deprecated and will change in Tornado 7.0 to use a thread pool by default. environ(request: HTTPServerRequest) → Dict[str, Any] Converts a tornado.httputil.HTTPServerRequest0 码力 | 268 页 | 1.09 MB | 1 年前3
Tornado 6.3 Documentation
The thread pool size can be configured with: Resolver.configure('tornado.netutil.ThreadedResolver', num_threads=10) Changed in version 3.1: All ThreadedResolvers share a single thread pool, whose size application will run on the event loop thread in Tornado 6.3; this will change to use an internal thread pool by default in Tornado 7.0. Warning: By default, the WSGI application is executed on the event loop’s application on the event loop thread is deprecated and will change in Tornado 7.0 to use a thread pool by default. environ(request: HTTPServerRequest) → Dict[str, Any] Converts a tornado.httputil.HTTPServerRequest0 码力 | 264 页 | 1.06 MB | 1 年前3
Tornado 6.5 DocumentationThe thread pool size can be configured with: Resolver.configure('tornado.netutil.ThreadedResolver', num_threads=10) Changed in version 3.1: All ThreadedResolvers share a single thread pool, whose size application will run on the event loop thread in Tornado 6.3; this will change to use an internal thread pool by default in Tornado 7.0. Warning: By default, the WSGI application is executed on the event loop’s application on the event loop thread is deprecated and will change in Tornado 7.0 to use a thread pool by default. environ(request: HTTPServerRequest) → Dict[str, Any] Converts a tornado.httputil.HTTPServerRequest0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 5.1 Documentation
The thread pool size can be configured with: Resolver.configure('tornado.netutil.ThreadedResolver', num_threads=10) Changed in version 3.1: All ThreadedResolvers share a single thread pool, whose size different attribute name, pass a keyword argument to the decorator: @run_on_executor(executor='_thread_pool') def foo(self): pass This decorator should not be confused with the similarly-named IOLoop.run_in_executor stack_context-aware library like tornado. ioloop or tornado.iostream (for example, if you’re writing a thread pool), use stack_context. wrap() before any asynchronous operations to capture the stack context from where0 码力 | 243 页 | 895.80 KB | 1 年前3
Tornado 5.1 Documentation
standard library since Python 3.2, installable with pip install futures in older versions). The thread pool size can be configured with: Resolver.configure('tornado.netutil.ThreadedResolver', num_threads=10) Changed in version 3.1: All ThreadedResolvers share a single thread pool, whose size is set by the first one to be created. Deprecated since version 5.0: The default Resolver now different attribute name, pass a keyword argument to the decorator: @run_on_executor(executor='_thread_pool') def foo(self): pass This decorator should not be confused with the similarly-named IOLoop.run_in_executor0 码力 | 359 页 | 347.32 KB | 1 年前3
Tornado 6.4 Documentation
standard library since Python 3.2, installable with pip install futures in older versions). The thread pool size can be configured with: Resolver.configure('tornado.netutil.ThreadedResolver', num_threads=10) Changed in version 3.1: All ThreadedResolvers share a single thread pool, whose size is set by the first one to be created. Deprecated since version 5.0: The default Resolver now application will run on the event loop thread in Tornado 6.3; this will change to use an internal thread pool by default in Tornado 7.0. Warning By default, the WSGI application is executed on the event loop’s0 码力 | 432 页 | 402.58 KB | 1 年前3
共 20 条
- 1
- 2













