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

Switch to using request.Context() #5782

Merged
merged 1 commit into from
Nov 19, 2018
Merged

Switch to using request.Context() #5782

merged 1 commit into from
Nov 19, 2018

Conversation

whyrusleeping
Copy link
Member

Was looking through the http handler code. When we figured out this CloseNotify stuff initially, I remember being super excited. That was quite some time ago, things have gotten better since then. The request.Context() now will cancel when the client leaves, or when the http server is shutdown, which is exactly what we want here.

This approach also frees us from having to run another extra goroutine. Yay.

License: MIT
Signed-off-by: Jeromy jeromyj@gmail.com

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
@ghost ghost assigned whyrusleeping Nov 19, 2018
@ghost ghost added the status/in-progress In progress label Nov 19, 2018
@Stebalien Stebalien merged commit ebc7cdc into master Nov 19, 2018
@Stebalien
Copy link
Member

Deprecated: the CloseNotifier interface predates Go's context package. New code should use Request.Context instead.

@ghost ghost removed the status/in-progress In progress label Nov 19, 2018
@Stebalien Stebalien deleted the feat/http-context branch November 19, 2018 22:49
hacdias pushed a commit to ipfs/boxo that referenced this pull request Jan 27, 2023
Switch to using request.Context()

This commit was moved from ipfs/kubo@ebc7cdc
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