Skip to content

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

Closed
jakecoffman wants to merge 10 commits into
vmware:mainfrom
jakecoffman:context
Closed

adding context to allow timeout/cancellation of http request#365
jakecoffman wants to merge 10 commits into
vmware:mainfrom
jakecoffman:context

Conversation

@jakecoffman

Copy link
Copy Markdown

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

jakecoffman commented Mar 25, 2021

Copy link
Copy Markdown
Author

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

lelvisl commented Jun 16, 2021

Copy link
Copy Markdown
Contributor

@jakecoffman will you continue to work on this PR?

@jakecoffman

Copy link
Copy Markdown
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