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

Method call_soon_threadsafe

Lib/asyncio/base_events.py:875–887  ·  view source on GitHub ↗

Like call_soon(), but thread-safe.

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

Source from the content-addressed store, hash-verified

873 "than the current one")
874
875 def call_soon_threadsafe(self, callback, *args, context=None):
876 """Like call_soon(), but thread-safe."""
877 self._check_closed()
878 if self._debug:
879 self._check_callback(callback, 'call_soon_threadsafe')
880 handle = events._ThreadSafeHandle(callback, args, self, context)
881 self._ready.append(handle)
882 if handle._source_traceback:
883 del handle._source_traceback[-1]
884 if handle._source_traceback:
885 del handle._source_traceback[-1]
886 self._write_to_self()
887 return handle
888
889 def run_in_executor(self, executor, func, *args):
890 self._check_closed()

Callers 3

_do_shutdownMethod · 0.95
set_debugMethod · 0.95

Calls 4

_check_closedMethod · 0.95
_check_callbackMethod · 0.95
_write_to_selfMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected