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

Add support for asynchronous usage #113

Open
karolzlot opened this issue Jan 30, 2022 · 4 comments
Open

Add support for asynchronous usage #113

karolzlot opened this issue Jan 30, 2022 · 4 comments
Labels
✨ enhancement New feature or request

Comments

@karolzlot
Copy link

Is your feature request related to a problem? Please describe.
I think as this project will grow it is good idea to allow to have async calls to API.

Describe the solution you'd like
I think that the best approach is to replace requests with httpx.

Describe alternatives you've considered
n/d

Additional context
n/d

@daneah daneah added the ✨ enhancement New feature or request label Jan 30, 2022
@daneah
Copy link
Member

daneah commented Jan 30, 2022

Thanks for opening this request @karolzlot! We've discussed this a couple of times internally and I think I even looked specifically at httpx briefly to understand what it might look like. This is a very good opportunity, especially if the solution can easily continue to support both synchronous and asynchronous usage.

@daneah daneah changed the title Add support for async an httpx Add support for asynchronous usage Jan 30, 2022
@karolzlot
Copy link
Author

One more idea: as this is package intended to be used by other projects, it may be good idea to implement this funcionality with AnyIO: https://www.python-httpx.org/async/#anyio

@daneah
Copy link
Member

daneah commented Feb 1, 2022

I'm not too familiar with AnyIO—I would need to better understand it before weighing in.

I'm also thinking about how we might expose the (optional) async capability in this package—namely, I'd like to avoid or abstract the challenge of code color as much as possible.

@karolzlot
Copy link
Author

karolzlot commented Feb 2, 2022

I was also thinking about it. As far as I can see, there is no ideal solution: https://stackoverflow.com/questions/55152952/duplication-of-code-for-synchronous-and-asynchronous-implementations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants