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

adding context to allow timeout/cancellation of http request #365

Closed
wants to merge 10 commits into from

Conversation

jakecoffman
Copy link

Description

Related issue: #362

I switched out the two http.NewRequest calls with http.NewRequestWithContext and then just started passing context.Context down through all the functions.

This will allow users to set timeouts on the http operations or cancel them manually such as ctrl-c on a command line or graceful server shutdown.

@jakecoffman
Copy link
Author

jakecoffman commented Mar 25, 2021

I assume this should go on a /v3 since it changes all of the method signatures. I just wanted to put this up to communicate what I was needing for my project. I'll squash this onto my fork so if anyone wants to cherry-pick it later it will be easier to pull back upstream.

@lelvisl
Copy link
Contributor

lelvisl commented Jun 16, 2021

@jakecoffman will you continue to work on this PR?

@jakecoffman
Copy link
Author

@lelvisl no, sorry too much work for me to keep it updated to master.

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.

2 participants