arlyon / async-stripe

Async (and blocking!) Rust bindings for the Stripe API
https://payments.rs
Apache License 2.0
467 stars 131 forks source link

Allow specifying RequestStrategy on per request on next #628

Open TroyKomodo opened 4 weeks ago

TroyKomodo commented 4 weeks ago

Is your feature request related to a problem? Please describe.

image

Currently the config override is specified on a per request basis but there is no way for any client to modify this value.

The difference between doing this and constructing a new client is this will reuse the underlying hyper connection pool. If we invoke the client builder (the only way i found to set the request strategy) we create an entirely new connection pool.

Describe the solution you'd like

Ideally I would like

image

These 2 methods to be exposed on the CustomizedStripeRequest struct aswell so we can do something like this

image

Describe alternatives you've considered

image

Currently we are resorting to this.

Additional context

No response