How to make the async requests?


#1

I’m developing the async application with uvicorn. One of the schedular function need to make more than 400 http request and it takes around 3 minutes to complete.

It will be great requests library officially support async but it’s not, may be in the near future. And I see the requests-thread in github page. I tried that it gave me error and I can’t able to make it work.

Can you please give me suggestion how do I proceed with async requests in apistar


#2

Use ‘aiorequests’

Version 3 of ‘requests’ will support async usage too, it’s possible that that’s already in a usable state.


#3

I see two aiorequests in github. You mean https://github.com/pohmelie/aiorequests this ? or https://github.com/jsandovalc/aiorequests ?


#4

Sorry, misremembered the name. aiohttp

https://aiohttp.readthedocs.io/en/stable/client_quickstart.html#make-a-request


#5

you can also use gevent !