MCPcopy Index your code
hub / github.com/RustPython/RustPython / shutdown_default_executor

Method shutdown_default_executor

Lib/asyncio/base_events.py:595–617  ·  view source on GitHub ↗

Schedule the shutdown of the default executor. The timeout parameter specifies the amount of time the executor will be given to finish joining. The default value is None, which means that the executor will be given an unlimited amount of time.

(self, timeout=None)

Source from the content-addressed store, hash-verified

593 })
594
595 async def shutdown_default_executor(self, timeout=None):
596 """Schedule the shutdown of the default executor.
597
598 The timeout parameter specifies the amount of time the executor will
599 be given to finish joining. The default value is None, which means
600 that the executor will be given an unlimited amount of time.
601 """
602 self._executor_shutdown_called = True
603 if self._default_executor is None:
604 return
605 future = self.create_future()
606 thread = threading.Thread(target=self._do_shutdown, args=(future,))
607 thread.start()
608 try:
609 async with timeouts.timeout(timeout):
610 await future
611 except TimeoutError:
612 warnings.warn("The executor did not finishing joining "
613 f"its threads within {timeout} seconds.",
614 RuntimeWarning, stacklevel=2)
615 self._default_executor.shutdown(wait=False)
616 else:
617 thread.join()
618
619 def _do_shutdown(self, future):
620 try:

Callers

nothing calls this directly

Calls 6

create_futureMethod · 0.95
startMethod · 0.95
joinMethod · 0.95
timeoutMethod · 0.45
warnMethod · 0.45
shutdownMethod · 0.45

Tested by

no test coverage detected