MCPcopy
hub / github.com/grpc/grpc-go / endOfClientStream

Function endOfClientStream

stream.go:188–202  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

186// failed streams. This includes incrementing channelz stats and invoking all
187// registered OnFinish call options.
188func 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
204func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (_ ClientStream, err error) {
205 if channelz.IsOn() {

Callers 2

newClientStreamFunction · 0.85
finishMethod · 0.85

Calls 3

IsOnFunction · 0.92
incrCallsFailedMethod · 0.45
incrCallsSucceededMethod · 0.45

Tested by

no test coverage detected