MCPcopy Index your code
hub / github.com/python/cpython / run_in_executor

Method run_in_executor

Lib/asyncio/base_events.py:889–903  ·  view source on GitHub ↗
(self, executor, func, *args)

Source from the content-addressed store, hash-verified

887 return handle
888
889 def run_in_executor(self, executor, func, *args):
890 self._check_closed()
891 if self._debug:
892 self._check_callback(func, 'run_in_executor')
893 if executor is None:
894 executor = self._default_executor
895 # Only check when the default executor is being used
896 self._check_default_executor()
897 if executor is None:
898 executor = concurrent.futures.ThreadPoolExecutor(
899 thread_name_prefix='asyncio'
900 )
901 self._default_executor = executor
902 return futures.wrap_future(
903 executor.submit(func, *args), loop=self)
904
905 def set_default_executor(self, executor):
906 if not isinstance(executor, concurrent.futures.ThreadPoolExecutor):

Callers 4

getaddrinfoMethod · 0.95
getnameinfoMethod · 0.95
_sendfile_fallbackMethod · 0.95

Calls 4

_check_closedMethod · 0.95
_check_callbackMethod · 0.95
submitMethod · 0.95

Tested by

no test coverage detected