FR: AutoClosable AttachedContext
Open
enhancement
- Dominant language
- Java
- Stars
- 12.1k
- Forks
- 4k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 37
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.