-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implicit Context #2
base: master
Are you sure you want to change the base?
Conversation
CC @liyanhui1228 For an opinion on how this looks from the perspective of a contributor to OpenCensus. See #1 (comment) and the following conversation for context on this discussion. |
cc @c24t for OpenCensus Python |
""" | ||
# NOTE: The return type here closely mirrors the original | ||
# GenericClientInterceptor interface. We may want to clean it up. | ||
def intercept_call(client_call_details: grpc.aio.ClientCallDetails, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async
?
client_call_details.credentials) | ||
return new_client_call_details, request_generator, None | ||
|
||
return grpc.aio.generic_client_interceptor(intercept_call) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just asking, generic_client_interceptor
would provide a way for creating an interceptor without needing to implement a derivated interceptor class? does it exist in the current API?
|
||
async def CreateUser(self, | ||
request: user_pb2.CreateUserRequest, | ||
context: grpc.aio.ServicerContext): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have also an example of how the timeout could be modified by the server evaluating the timeout provided by the context, for making a decision if the timeout needs to be modified or if it does not exist adding it.
stack from server to client. But without middleware installed, *nothing* is | ||
propagated by default, except timeout and cancellation, which are handled by the | ||
gRPC library itself using `ContextVar` objects managed by the `gRPC` library | ||
itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are on the same page!
This PR is a an example illustrating a proposal for how to handle distributed context within the gRPC Python asyncio API.
@pfreixes
@lidizheng
@euroelessar