-
Notifications
You must be signed in to change notification settings - Fork 42
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
http: use the request context #163
Conversation
5c1828c
to
80dbf04
Compare
Context() context.Context | ||
} | ||
// Environment is the environment passed to commands. | ||
type Environment interface{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(doesn't break anything in either go-filecoin or go-ipfs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should MakeEnvironment
be removed/altered with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need the environment (we type assert it to something more useful).
Really, we should consider stashing everything we'd usually put in the environment in the context (which is, IMO, where it should go) but we can handle that later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 nit
http/parse.go
Outdated
@@ -1,7 +1,8 @@ | |||
package http | |||
|
|||
import ( | |||
"context" | |||
"crypto/rand" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to use 'math/rand', it's 10-30x faster
CloseNotifier has been deprecated for a while. Also, ditch the "environment" context. We don't actually _need_ this.
80dbf04
to
8d7fadf
Compare
CloseNotifier has been deprecated for a while.
Also, ditch the "environment" context. We don't actually need this.