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

Method close

Lib/asyncio/base_events.py:729–750  ·  view source on GitHub ↗

Close the event loop. This clears the queues and shuts down the executor, but does not wait for the executor to finish. The event loop must not be running.

(self)

Source from the content-addressed store, hash-verified

727 self._stopping = True
728
729 def close(self):
730 """Close the event loop.
731
732 This clears the queues and shuts down the executor,
733 but does not wait for the executor to finish.
734
735 The event loop must not be running.
736 """
737 if self.is_running():
738 raise RuntimeError("Cannot close a running event loop")
739 if self._closed:
740 return
741 if self._debug:
742 logger.debug("Close %r", self)
743 self._closed = True
744 self._ready.clear()
745 self._scheduled.clear()
746 self._executor_shutdown_called = True
747 executor = self._default_executor
748 if executor is not None:
749 self._default_executor = None
750 executor.shutdown(wait=False)
751
752 def is_closed(self):
753 """Returns True if the event loop was closed."""

Callers 2

__del__Method · 0.95
check_in_threadMethod · 0.95

Calls 4

is_runningMethod · 0.95
debugMethod · 0.45
clearMethod · 0.45
shutdownMethod · 0.45

Tested by 1

check_in_threadMethod · 0.76