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 · 3 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.

@homier
Copy link

homier commented Nov 28, 2024

@hdonnay hey! I've just made a PR with setting a base context for server connection (#595), is it what you've been looking for?

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

3 participants