add_done_callback(fn)
Add a callback to be run when the future becomes done.
The callback is called with a single argument - the future object. If the future is already done when this is called, the callback is scheduled with call_soon()
.
Use functools.partial to pass parameters to the callback. For example, fut.add_done_callback(functools.partial(print, "Future:",
flush=True))
will call print("Future:", fut, flush=True)
.
Please login to continue.