(self, executor, func, *args)
| 882 | return handle |
| 883 | |
| 884 | def run_in_executor(self, executor, func, *args): |
| 885 | self._check_closed() |
| 886 | if self._debug: |
| 887 | self._check_callback(func, 'run_in_executor') |
| 888 | if executor is None: |
| 889 | executor = self._default_executor |
| 890 | # Only check when the default executor is being used |
| 891 | self._check_default_executor() |
| 892 | if executor is None: |
| 893 | executor = concurrent.futures.ThreadPoolExecutor( |
| 894 | thread_name_prefix='asyncio' |
| 895 | ) |
| 896 | self._default_executor = executor |
| 897 | return futures.wrap_future( |
| 898 | executor.submit(func, *args), loop=self) |
| 899 | |
| 900 | def set_default_executor(self, executor): |
| 901 | if not isinstance(executor, concurrent.futures.ThreadPoolExecutor): |
no test coverage detected