-
Notifications
You must be signed in to change notification settings - Fork 24
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
[Feature Request] Per-Request Context Support #95
Comments
Interesting, do you have an example of this pattern? As a relatively new Go developer, I don't have all the patterns down to be fully idiomatic. |
Glad you found it interesting! Here are some official resources for understanding the context pattern in Go: You may also find this example useful for seeing the pattern in action with the AWS SDK for Go: For example, using |
Hey @gregnazario Feel free to assign it to me if it’s ready to move forward. I’m happy to implement the necessary changes. |
🚀 Feature Request Description
Enable passing a context for each client method, instead of relying on a global timeout for the entire client.
Motivation
Is your feature request related to a problem? Please describe you use case.
A global timeout for all requests isn’t flexible enough. Some requests only need a few seconds, while others may take much longer. I need to handle short-duration requests without blocking event loops, while also supporting longer ones when necessary.
Pitch
Describe the solution you would like
Solution: Follow Go’s standard pattern by adding a
context.Context
as the first argument for each method. This would allow us to remove the global timeout on the HTTP client, relying on the context to manage request durations. Usecontext.Background()
when no specific context is needed.Describe alternatives you've considered
None at the moment.
Are you willing to open a pull request?
Yes, I’m happy to implement this if the feature is accepted.
Additional context
None
The text was updated successfully, but these errors were encountered: