endOfClientStream performs cleanup actions required for both successful and failed streams. This includes incrementing channelz stats and invoking all registered OnFinish call options.
(cc *ClientConn, err error, opts ...CallOption)
| 186 | // failed streams. This includes incrementing channelz stats and invoking all |
| 187 | // registered OnFinish call options. |
| 188 | func endOfClientStream(cc *ClientConn, err error, opts ...CallOption) { |
| 189 | if channelz.IsOn() { |
| 190 | if err != nil { |
| 191 | cc.incrCallsFailed() |
| 192 | } else { |
| 193 | cc.incrCallsSucceeded() |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | for _, o := range opts { |
| 198 | if o, ok := o.(OnFinishCallOption); ok { |
| 199 | o.OnFinish(err) |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (_ ClientStream, err error) { |
| 205 | if channelz.IsOn() { |
no test coverage detected