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

http: use the request context #163

Merged
merged 2 commits into from
May 13, 2019
Merged

http: use the request context #163

merged 2 commits into from
May 13, 2019

Conversation

Stebalien
Copy link
Member

CloseNotifier has been deprecated for a while.

Also, ditch the "environment" context. We don't actually need this.

@Stebalien Stebalien requested a review from keks as a code owner April 30, 2019 18:57
@ghost ghost assigned Stebalien Apr 30, 2019
@ghost ghost added the status/in-progress In progress label Apr 30, 2019
@Stebalien Stebalien requested a review from djdv April 30, 2019 18:57
Context() context.Context
}
// Environment is the environment passed to commands.
type Environment interface{}
Copy link
Member Author

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)

Copy link
Contributor

@djdv djdv Apr 30, 2019

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?

Copy link
Member Author

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.

Copy link
Member

@magik6k magik6k left a 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"
Copy link
Member

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.
@Stebalien Stebalien merged commit ad94722 into master May 13, 2019
@Stebalien Stebalien deleted the fix/http-context branch May 13, 2019 17:27
@Stebalien Stebalien removed the status/in-progress In progress label May 13, 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

Successfully merging this pull request may close these issues.

3 participants