MCPcopy Index your code
hub / github.com/dabeaz/python-cookbook / apply_async

Function apply_async

src/7/inlining_callback_functions/example.py:5–10  ·  view source on GitHub ↗
(func, args, *, callback)

Source from the content-addressed store, hash-verified

3# Sample function to illustrate callback control flow
4
5def apply_async(func, args, *, callback):
6 # Compute the result
7 result = func(*args)
8
9 # Invoke the callback with the result
10 callback(result)
11
12# Inlined callback implementation
13from queue import Queue

Callers 1

wrapperFunction · 0.70

Calls 1

funcFunction · 0.50

Tested by

no test coverage detected