After #1509 gets merged we will now have External Connection health check methods which is great ...except that they all run synchronously and can take a long time.
It would be nice to change it to be async with asyncio.gather!
Paraphrasing @MelissaAutumn here:
If you do make this async you'll have to make every other function that calls it async. If it's just a view function that calls it, then that'll be okay since fastapi says it automatically handles async view functions.
Ah asyncio.gather should be similar to Promises.all afaik
https://docs.python.org/3/library/asyncio-task.html#asyncio.gather
You'll basically just build a loop of the async tasks, and results = await asyncio.gather(tasks, return_exceptions=True) at the end.
In order to support the update, you'll need to punt essentially the loop's contents into a new function. And that new function will be the task you gather up to run async.
After #1509 gets merged we will now have External Connection health check methods which is great ...except that they all run synchronously and can take a long time.
It would be nice to change it to be async with asyncio.gather!
Paraphrasing @MelissaAutumn here:
https://docs.python.org/3/library/asyncio-task.html#asyncio.gather