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

server implementations should be able to specify a root context other than context.Background() #577

Open
hdonnay opened this issue Jul 12, 2024 · 2 comments

Comments

@hdonnay
Copy link

hdonnay commented Jul 12, 2024

While looking at adding a capnproto-rpc interface to a project, I came to the conclusion that there's no equivalent to http.Server's BaseContext/ConnContext. This makes context propagation a chore, as a parent context would need to be passed in whatever concrete type is being used and then every method would need to use some tricky code to tie the signalling between the parent and request contexts together.

@matheusd
Copy link
Contributor

Are you evaluating master?

@hdonnay
Copy link
Author

hdonnay commented Jul 13, 2024

Yeah; as best I can tell Serve ends up here, which unconditionally uses a background context. The context passed into ListenAndServe is only used for cancellation.

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

No branches or pull requests

2 participants