Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
419 views
in Technique[技术] by (71.8m points)

Python asyncio for sequential HTTP requests and processing data during waiting response

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...