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

Function callback

Lib/asyncio/tasks.py:1016–1024  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1014 future = concurrent.futures.Future()
1015
1016 def callback():
1017 try:
1018 futures._chain_future(ensure_future(coro, loop=loop), future)
1019 except (SystemExit, KeyboardInterrupt):
1020 raise
1021 except BaseException as exc:
1022 if future.set_running_or_notify_cancel():
1023 future.set_exception(exc)
1024 raise
1025
1026 loop.call_soon_threadsafe(callback)
1027 return future

Callers 5

_registerMethod · 0.70
_pollMethod · 0.70
_do_waitMethod · 0.70
_invoke_callbacksMethod · 0.50
call_callbacksMethod · 0.50

Calls 3

ensure_futureFunction · 0.85
set_exceptionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…