-
Notifications
You must be signed in to change notification settings - Fork 203
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
Creating a context for each call is tedious #310
Comments
Thanks for the suggestion! I'm sympathetic to this point of view, but the problem is that the best default for a context would do things that
I would love for this to be the behavior of Other options:
|
The extension trait (with The decreasing deadline doesn't feel like a critical invariant. Instead, I'd expect the timeout would generally need to increase with the number of network hops. |
It seems like the concerns are related to the situation where a server makes rpc calls to another server. In the scenario where that's not the case (which is how I use it) using Edit: Maybe |
@drewkett apologies for never responding to your suggestion! I could potentially see value in an opt-in simple client — I wouldn't want it to be generated by default since it's more codegen that some users won't need. One alternative would be an alias for use tarpc::context::current as c; then you could write something like |
Adding
context::current()
to every RPC call isn't too fun. What if we added an option totarpc::service
such that eachContext
parameter was tucked under the hood?The text was updated successfully, but these errors were encountered: