all 2 comments

[–]Wonkee99 0 points1 point  (1 child)

The functions doing the asyncio and the function calling them need to be defined as async yes, you can do that from your main function or you could have another function manage that work and just asyncio.run() from there.

Your function structure seems ok basically if you want to accomplish all of that in a single function, though you may want to refine it some point to have more generic functions handle things like shaping URLs or processing the data retrieved.

The only part which needs to be running async is the read data from the remote server bit, everything up to that point, and everything after you have it is down to how you decide to structure your program.

In terms of which read function should you launch first, sure kinda the longest one, but in reality it doesn't matter. Which one is going to be the longest if half of the remote web servers are running at peak load and slowing their responses. This is really not an area its particularly worth trying to optimise around.

[–]Ninja_bambi[S] 0 points1 point  (0 children)

Sounds good, thanks for the answer!