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

Allow cancelable requests using contexts #102

Closed
dadgar opened this issue Apr 6, 2018 · 4 comments
Closed

Allow cancelable requests using contexts #102

dadgar opened this issue Apr 6, 2018 · 4 comments

Comments

@dadgar
Copy link
Contributor

dadgar commented Apr 6, 2018

It would be nice to provide a mechanism in which to be able to cancel the request. If we standardized on using contexts, the cancel could be done because it is no longer needed or to implement a timeout (https://golang.org/pkg/context/#WithTimeout)

@mitchellh
Copy link
Contributor

Yeah I think standardizing on context.Context makes sense. My recommendations would be:

  • Make it a field in Client

  • Modify (break API, assume vendoring) the interfaces Getter, Decompressor, etc. to support a first context parameter. Those should be honored for cancellation if possible. I think breaking API compat at this layer is safer than the top-level, since its generally unlikely anyone is using a custom Getter.

  • Add new top-level GetContext, GetFileContext, GetAnyContext methods so we preserve backwards compatibility on the top-level funcs.

@MithunArunan
Copy link

I will pick this up. Can you please assign it to me @dadgar @mitchellh

@dadgar
Copy link
Contributor Author

dadgar commented Nov 14, 2019

@MithunArunan Feel free to post a PR once you have the feature. We do not generally assign tickets to outside contributors.

@azr
Copy link
Contributor

azr commented Nov 19, 2019

Howdy 🙂 ! The go-getter is now cancellable as per #133 I think this issue can be closed !

Feel free to open an issue is there's a missing feature or a bug !

@azr azr closed this as completed Nov 19, 2019
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

No branches or pull requests

4 participants