From: Ben Darnell Date: Sat, 23 Dec 2017 02:28:33 +0000 (-0500) Subject: asyncio: Delegate executor methods to asyncio loop X-Git-Tag: v5.0.0~30^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfe8e9ea0e6ee1d3dde52d1795bf6ead39afb3b5;p=thirdparty%2Ftornado.git asyncio: Delegate executor methods to asyncio loop Avoid creating a second default thread pool to be managed. --- diff --git a/tornado/platform/asyncio.py b/tornado/platform/asyncio.py index 0e81277c5..63937b22e 100644 --- a/tornado/platform/asyncio.py +++ b/tornado/platform/asyncio.py @@ -140,6 +140,12 @@ class BaseAsyncIOLoop(IOLoop): add_callback_from_signal = add_callback + def run_in_executor(self, executor, func, *args): + return self.asyncio_loop.run_in_executor(executor, func, *args) + + def set_default_executor(self, executor): + return self.asyncio_loop.set_default_executor(executor) + class AsyncIOMainLoop(BaseAsyncIOLoop): """``AsyncIOMainLoop`` creates an `.IOLoop` that corresponds to the