Kelvin DeCosta
02/21/2023, 12:05 PMasync
execution of tasks via .map
.
In the documentation for the .map
function, it mentions that if the task that is being mapped is async
, then the .map
call must be awaited.
However, I keep getting an error with the type checker stating that there are no overloads of .map
that can be awaited.
What should could be done to fix this?Zanie
Kelvin DeCosta
02/22/2023, 9:13 AM# using .submit
cors = [my_task.submit(param1=p, return_state=True) for p in params]
states = await asyncio.gather(*cors)
# using .map
states = await my_task.map(param1=params, return_state=True)
Kelvin DeCosta
02/22/2023, 9:13 AMreturn_state=True
and async
tasksZanie
Zanie
Kelvin DeCosta
02/22/2023, 4:43 PM