FR: AutoClosable AttachedContext
オープン
enhancement
- 主要言語
- Java
- スター
- 12.1k
- フォーク
- 4k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 37
説明
Today, if you want to use [`io.grpc.Context.attach()`](https://grpc.io/grpc-java/javadoc/io/grpc/Context.html#attach--), you have to provide your own `try`/`finally` block. In order to take advantage of try-with-resources, if there were a `AttachedContext` that implemented `java.lang.AutoClosable`, then you could have
try (AttachedContext ac = new AttachedContext(context)) {
…
}
and omit the `finally` block.
コントリビューションガイド
調査の方向性
Issue に記載されている API io.grpc.Context.attach() から始め、現在、アタッチされたコンテキストがどのように復元されているかを調査します。呼び出し元の try/finally パターンを try-with-resources に置き換えられるように AttachedContext リソースを定義し、それを閉じると以前のコンテキストが復元されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- api, backend
- issue の種類
- 機能追加
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 35/100