grpc / grpc/grpc-java

Method type specific MethodDescriptor wrapper

オープン
#6,252 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Java
スター
12.1k
フォーク
4k
平均マージ
2日 17時間
マージ済み PR(30日)
37

説明

### 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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず既存の MethodDescriptor API と RequestMethods API を確認し、次に grpc-java ツールが現在どのようにメソッド型を区別しているかを追跡します。メソッド固有のラッパーの範囲と、それらが提供すべきコンパイル時の動作を定義します。API が実行時チェックに依存せず、4 つのリクエスト/レスポンスメソッド形状をサポートすれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
grpc, java
領域
api, developer-experience
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。