-
-
Notifications
You must be signed in to change notification settings - Fork 286
Async storage buckets #61
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
Conversation
Personally, I don't think The reason is that a method is made I think that the path that the HTTPX itself follows is a good one, that of using two different classes. |
I agree, it's not the neatest solution out there, I'm open to suggestions. I was mainly trying to reduce the amount of code duplication that would occur with two separate classes. |
I have been investigating and I think this way is very good. I will test it with The idea is to use https://sethmlarson.dev/blog/2020-06-27/designing-libraries-for-async-and-sync-io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits but otherwise looks good to me. I think it's quite well put together so kudos on that. Thanks much!
Ping me(J0) on discord if you haven't received any swag yet.
@leynier I think you raise some great points about splitting the code into separate async/sync clients. The links provided are really helpful so thank you for pointing this out! We can poll the community and see what they'd prefer and switch if necessary but for now I hope to accept this PR. What do both of you think? |
All good for me 👌🏼 |
Hey @J0 @leynier @anand2312! Nevertheless, this PR is such a good job, so I'm thinking in 2 options:
What do you all think? |
I'm willing to help in whatever is needed, so, I adjust to what @J0 and @anand2312 decide. |
Lgtm |
Sounds good to me! Going to merge this in. |
Thanks everyone for your inputs 😄 |
This PR adds async support to the
storage buckets API
by switching tohttpx
. All sync methods can now also be called with async/await syntax, by passingis_async=True
to theStorageBucketAPI
constructor (this value defaults to False).Other smaller changes:
name
,public
arguments toStorageBucketAPI.create_bucket
methodStorageException
, instead of excepting all errors and printing them out.storage_bucket_api.py
file (I might've gone a little overboard with that, sorry)