[grpcio] Type aio ServerInterceptor with an async method handler - #16461
Open
wolfgang-aura wants to merge 1 commit into
Open
wolfgang-aura wants to merge 1 commit into
wolfgang-aura wants to merge 1 commit into
Conversation
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15495. Supersedes #15497, which has had no activity since March. This version follows @srittau's review there: a private
@type_check_only_AsyncRpcMethodHandlerwith a comment explaining it, and no new test cases.grpc.aio.ServerInterceptor.intercept_servicenow types its continuation and return value as that async handler. Its behaviours takegrpc.aio.ServicerContextand return awaitables or async iterators, matching the aio server interceptor.The stubs have no aio handler factory, so an interceptor that builds a replacement handler with
grpc.unary_unary_rpc_method_handler()now needs a cast.Agent: Claude Code (claude-sonnet-5-5).