grpc / grpc/grpc-java

Method type specific MethodDescriptor wrapper

Open
#6,252 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
12.1k
Forks
4k
Avg merge
2d 17h
Merged PRs (30d)
37

Description

### Is your feature request related to a problem? Please describe.

It would be great if MethodDescriptors would be wrapped in method type specific class/interface, similar to RequestMethods. It would enable gRPC tooling to know what type of method it is at compile type, so it would be possible to return appropriate action interfaces based on the method type (does method have single/multiple request/responses). This would help to reduce the tools API verbosity and a bit of complexity.

### Describe alternatives you've considered
Current approach is to have differently named methods (unaryMethod(), serverStreamingMethod(), ...) and check if appropriate method type is passed at runtime.

### Additional context

I'm trying to create a gRPC method mocking tool for easier testing - [gRPCMock](https://github.com/Fadelis/grpcmock/). This feature would help determining what type of stub needs to be returned and have single name method for all types.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.