await multiple async functions get their output in array #7992
Replies: 5 comments
-
Sounds like you want Not sure what you are trying to use this for, but if you are trying to do this to make multiple database requests concurrently within a single request, that's often a bad idea due to transactions, etc. Otherwise, yeah, this should be the way to go. |
Beta Was this translation helpful? Give feedback.
-
so is it okay to use asyncio with fastapi? i thought there might be some conflicts. But this is good to go. |
Beta Was this translation helpful? Give feedback.
-
I would encourage you to read the docs. This page in particular. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help @dmontagu ! 🙇♂️ |
Beta Was this translation helpful? Give feedback.
-
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues. |
Beta Was this translation helpful? Give feedback.
-
I need to make multiple API requests with different parameters. Currently, doing this sequentially in a for loop. I was wondering if this can be handled asynchronously. In javascript, there is a way to do this with Promise.all. Please advise on how to handle this?
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions