-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[REQ][Go] Pass r.Context into handlers #6657
Labels
Comments
metalmatze
changed the title
[REQ][GO] Pass r.Context into handlers
[REQ][Go] Pass r.Context into handlers
Jun 14, 2020
Ah, I didn't mention that this is for the Go Server and not the client. |
Anyone to take a look. I'm happy to work on a PR, but want to know if that's wanted first. |
@metalmatze Thank you for registering the issue. 😄 |
ryutah
added a commit
to ryutah/openapi-generator
that referenced
this issue
Aug 14, 2020
ryutah
added a commit
to ryutah/openapi-generator
that referenced
this issue
Aug 14, 2020
Merged
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
I would like to propagate the request context through all levels of my application, so that I can use consistent request tracing across applications.
Describe the solution you'd like
Right now the generated handlers do not pass along the request or at least the request context. This can easily be fixed by:
Then all handlers of the services we need to implement have
ctx context.Context
as first argument. This should also make it possible for requests to close longer taking requests. If that's possible we could even cancel pretty heavy SQL queries etc.Describe alternatives you've considered
Didn't really consider an alternative, as this is pretty much what every one in Go does these days. 😊
The text was updated successfully, but these errors were encountered: