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

Beta: Support 'allow_sync_methods=False' in HTTPXClient #1253

Merged
merged 5 commits into from
Feb 27, 2024

Conversation

richardm-stripe
Copy link
Contributor

Summary

Allows initializing HTTPXClient so that synchronous method calls raise an exception.

Motivation

I expect this to be useful for users who want to completely migrate their Stripe integrations to use async control flow. It's easy to miss migrating a method or two, especially if it's a pagination request, and then you have blocking io that you didn't intend.

Brought this up #327 (comment) and at least one user has indicated it would be useful.

It's definitely not impossible for users to subclass HTTPXClient and implement this themselves so maybe this is feature bloat, but I think eventually suggesting this strategy in our README will be helpful, and it addresses some of the migration experience agonies that motivated #1247.

@richardm-stripe richardm-stripe requested review from a team and anniel-stripe and removed request for a team February 26, 2024 18:02
@richardm-stripe richardm-stripe enabled auto-merge (squash) February 27, 2024 17:14
@richardm-stripe richardm-stripe merged commit a0d85ca into beta Feb 27, 2024
14 checks passed
@xavdid-stripe xavdid-stripe deleted the richardm-disable-sync-option branch May 10, 2024 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants