I need help getting this done. I have a script that sequentially sends HTTP requests, processes the data once the response is received, and then immediately sends the next HTTP request. I would like to try to have the data processed while the script is waiting for the HTTP response, as shown in this image. This way I should optimize everything.
The logic of the script should be as follows: send HTTP request -> wait for response -> receive HTTP response, send another HTTP request -> process data while waiting for HTTP response -> receive HTTP response, send another HTTP request -> ...
How can I do this with asyncio?
question from:
https://stackoverflow.com/questions/65883333/python-asyncio-for-sequential-http-requests-and-processing-data-during-waiting-r 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…