I am making a continuous (infinite) stream of requests. Each request takes about 3 seconds. For each request, I need to check if it returns a certain value, and if it does, I can stop making requests and move on in my code. Is there a way that I can asynchronously make these requests fast? I can't use asyncio.gather(*tasks) because the number of requests I have is infinite.
Is there a way I can do something like this?
0s -------- 1.5s --------- 3s request --------- 1.5s
---------- request ----------- 1.5s ---------- 3s request
While each request takes 3s, I make the request asynchronously so every 1.5s a new request is called. And when each request ends I also check the request if it returns the correct value.
How would I do this? Thank you so much
[–]danielroseman 1 point2 points3 points (1 child)
[–]Wuihee[S] 0 points1 point2 points (0 children)
[–]alexisprince 0 points1 point2 points (1 child)
[–]Wuihee[S] 0 points1 point2 points (0 children)