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

Method call_soon

Lib/asyncio/base_events.py:822–839  ·  view source on GitHub ↗

Arrange for a callback to be called as soon as possible. This operates as a FIFO queue: callbacks are called in the order in which they are registered. Each callback will be called exactly once. Any positional arguments after the callback will be passed to

(self, callback, *args, context=None)

Source from the content-addressed store, hash-verified

820 return timer
821
822 def call_soon(self, callback, *args, context=None):
823 """Arrange for a callback to be called as soon as possible.
824
825 This operates as a FIFO queue: callbacks are called in the
826 order in which they are registered. Each callback will be
827 called exactly once.
828
829 Any positional arguments after the callback will be passed to
830 the callback when it is called.
831 """
832 self._check_closed()
833 if self._debug:
834 self._check_thread()
835 self._check_callback(callback, 'call_soon')
836 handle = self._call_soon(callback, args, context)
837 if handle._source_traceback:
838 del handle._source_traceback[-1]
839 return handle
840
841 def _check_callback(self, callback, method):
842 if (coroutines.iscoroutine(callback) or

Callers 1

start_tlsMethod · 0.95

Calls 4

_check_closedMethod · 0.95
_check_threadMethod · 0.95
_check_callbackMethod · 0.95
_call_soonMethod · 0.95

Tested by

no test coverage detected