I have 2 functions: the first, def_a , is an asynchronous function, and the second is def_b , which is a regular function and is called with the result of def_a as a callback using the add_done_callback function.
My code is as follows:
import asyncio def def_b(result): next_number = result.result()
And it works great.
The problem started when the second def_b function became asynchronous. Now it looks like this:
async def def_b(result): next_number = result.result()
But now I can not provide it to the add_done_callback function, because it is not a regular function.
My question is: is this possible and how can I provide def_b to the def_b function if def_b is asynchronous?
Yuval Pruss
source share