Improve usability of multi-valued ASCII keys
- 主要言語
- Java
- スター
- 12.1k
- フォーク
- 4k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 37
説明
For keys like Grpc-Accept-Encoding ["gzip", "deflate"] is semantically equivalent to ["gzip,deflate"]. We should have a utility or tweak our API to make encourage applications to handle multi-valued metadata correctly.
A separate but related issue is that users of Keys have to be aware of whether the key is for ascii or binary, since you are likely to use the get() methods differently between the two. It might be good to have some "meta" key that could behave identically between the two.
For example, we could have something like:
``` java
public interface MultivalueMarshaller {
List splitValues(C combined);
C combineValues(List separate);
}
```
Which could be used as a special key:
```
new Metadata.Key.of("Grpc-Accept-Encoding", new MultivalueAcceptEncoding(), new AcceptEncodingMarshaller());
```
The key would always act as if there was only one value, and would typically be used with `Metadata.get()`.
I'm not 100% sold on the example solution, because it seems we keep adding more and more layers.
コントリビューションガイド
調査の方向性
The issue names no files, tests, or concrete entry point. Start by locating Metadata.Key and the existing ASCII and binary key APIs, then compare their handling of multi-valued metadata. Done should mean an agreed API design with coverage for equivalent separated and combined values, but the issue does not define the final approach.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- grpc, java
- 領域
- api, backend-api-design
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100