Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Include Async support #4

Open
arthanson opened this issue Mar 30, 2023 · 9 comments
Open

feat: Include Async support #4

arthanson opened this issue Mar 30, 2023 · 9 comments
Labels
enhancement Enhancement of the code, not introducing new features.

Comments

@arthanson
Copy link
Contributor

Feature Request

Describe the Feature Request

Request was made to potentially add async support.

@arthanson arthanson added the enhancement Enhancement of the code, not introducing new features. label Mar 30, 2023
@emersonfelipesp
Copy link

What about using FastAPI framework?

@meibenny
Copy link

meibenny commented May 3, 2023

I would love to see async support.

@markkuleinio
Copy link

Absolutely. Using NetBox API is IMO a prime candidate for async: some calls often take a long time to execute, and giving the client a flexible possibility to do other tasks meanwhile is important.

requests made API calls easy, but it won't get async support. I think it shouldn't be used in new API wrappers anymore. There are other options that support async and are used in very similar way to requests.

@meibenny
Copy link

meibenny commented May 4, 2023

There was some discussion in slack about using aiohttp or httpx

@arthanson
Copy link
Contributor Author

Here is a good overview: https://www.scrapingbee.com/blog/best-python-http-clients/

I'm leaning towards httpx (https://github.com/encode/httpx/), seems to have all the features of aiohttp and supports http2 if needed, also more compatible with the current requests library. Interest in it (from github stars and such, seems to be growing faster then aiohttp).

@meibenny
Copy link

meibenny commented May 5, 2023

It makes sense to me to use a library that's compatible with requests, has async support, and a large community behind it. I'm not sure what, if anything, aiohttp offers over httpx.

@tyler-8
Copy link

tyler-8 commented May 9, 2023

I use httpx a lot for internal API clients and it's a great library. The lead maintainer is the same behind Django REST Framework and really knows HTTP.

The httpx APIs for async and sync are nearly identical, so it's quite easy to mix the two. I'd highly recommend it.

@drygdryg
Copy link

Uplink is a declarative HTTP client, which supports both sync and async I/O: https://github.com/prkumar/uplink

@deranjer
Copy link

I'd be interested in updating this with async support via httpx. I have it "working" currently minus some of the features in baseapi like all(). This is by shimming over your current implementation, but can pluck the changes to a PR to get async running.

However, your setup docs mention poetry, but I think that is out of date? Any chance you could let me know how to get the dev environment tooling setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the code, not introducing new features.
Projects
None yet
Development

No branches or pull requests

7 participants