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

context.Context support #11

Open
abhinav opened this issue Dec 25, 2018 · 1 comment · May be fixed by #25
Open

context.Context support #11

abhinav opened this issue Dec 25, 2018 · 1 comment · May be fixed by #25

Comments

@abhinav
Copy link
Contributor

abhinav commented Dec 25, 2018

Overview

Go client libraries typically accept a context.Context as the first
argument in all outgoing function calls. The context carries deadline and
other information across API boundaries. See also https://blog.golang.org/context.

Popular examples are,

Context also allows orchestrating cancelation, especially with concurrent
operations. Support for this is already built into http.Client.

Implementation

All methods that make an outgoing request would have to accept a
context.Context as their first argument and plumb it over to http.Client
with req.WithContext(ctx), likely in buildRequest or prepareRequest.

Because this will involve a breaking change to the API, it should probably be
bundled with any other breaking changes you have planned.

@thebaer
Copy link
Member

thebaer commented May 26, 2019

Great input! If anyone wants to jump on this for the v2 release of the library, please feel free to do so now. It'll be a good time to bring in this breaking change.

@thebaer thebaer added this to the v3 milestone Mar 16, 2023
@alyakimenko alyakimenko linked a pull request Apr 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants