This repository was archived by the owner on Nov 23, 2017. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838from .log import logger
3939
4040
41- __all__ = ['BaseEventLoop' , 'run_in_executor' ]
41+ __all__ = ['BaseEventLoop' ]
4242
4343
4444# Minimum number of _scheduled timer handles before cleanup of
5555 ConnectionResetError , ConnectionAbortedError )
5656
5757
58- @coroutine
59- def run_in_executor (executor , func , * args ):
60- """Run the function in a thread or a process pool.
61-
62- Any concurrent.futures executor can be passed to the
63- function.
64-
65- If executor is None, the function will be run in
66- the default threadpool of the event loop.
67-
68- Example:
69-
70- async def coro():
71- await asyncio.run_in_executor(
72- None, long_calculation, 42)
73- """
74- loop = events .get_event_loop ()
75- result = yield from loop .run_in_executor (executor , func , * args )
76- return result
77-
78-
7958def _format_handle (handle ):
8059 cb = handle ._callback
8160 if inspect .ismethod (cb ) and isinstance (cb .__self__ , tasks .Task ):
You can’t perform that action at this time.
0 commit comments