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.
asyncio/Future.add_done_callback
Future.add_done_callback