mirror of https://github.com/grpc/grpc-go.git
Currently, it is not possible to access trailers from within a stats.Handler. The reason is that both stats.Handler and ClientStream.Trailer require a lock on the ClientStream. A workaround would be to start a separate goroutine that will call ClientStream.Trailer asynchronously, but that requires careful coordination and we can quite easily make the trailer metadata available to the stats.Handler directly. Use case: an interceptor that processes trailer metadata for each streaming RPC after the stream has finished. Note that a StreamClientInterceptor returns immediately, before the stream has finished and before the trailer metadata is available. |
||
|---|---|---|
| .. | ||
| grpc_testing | ||
| handlers.go | ||
| stats.go | ||
| stats_test.go | ||