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

Method close

resolver_wrapper.go:111–125  ·  resolver_wrapper.go::ccResolverWrapper.close

close initiates async shutdown of the wrapper. To determine the wrapper has finished shutting down, the channel should block on ccr.serializer.Done() without cc.mu held.

()

Source from the content-addressed store, hash-verified

109// finished shutting down, the channel should block on ccr.serializer.Done()
110// without cc.mu held.
111func (ccr *ccResolverWrapper) close() {
112 channelz.Info(logger, ccr.cc.channelz, "Closing the name resolver")
113 ccr.mu.Lock()
114 ccr.closed = true
115 ccr.mu.Unlock()
116
117 ccr.serializer.TrySchedule(func(context.Context) {
118 if ccr.resolver == nil {
119 return
120 }
121 ccr.resolver.Close()
122 ccr.resolver = nil
123 })
124 ccr.serializerCancel()
125}
126
127// UpdateState is called by resolver implementations to report new state to gRPC
128// which includes addresses and service config.

Callers

nothing calls this directly

Calls 5

InfoFunction · 0.92
CloseMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
TryScheduleMethod · 0.45

Tested by

no test coverage detected