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

Method NewAddress

resolver_wrapper.go:163–180  ·  view source on GitHub ↗

NewAddress is called by the resolver implementation to send addresses to gRPC.

(addrs []resolver.Address)

Source from the content-addressed store, hash-verified

161// NewAddress is called by the resolver implementation to send addresses to
162// gRPC.
163func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) {
164 ccr.cc.mu.Lock()
165 ccr.mu.Lock()
166 if ccr.closed {
167 ccr.mu.Unlock()
168 ccr.cc.mu.Unlock()
169 return
170 }
171 s := resolver.State{
172 Addresses: addrs,
173 ServiceConfig: ccr.curState.ServiceConfig,
174 Endpoints: addressesToEndpoints(addrs),
175 }
176 ccr.addChannelzTraceEvent(s)
177 ccr.curState = s
178 ccr.mu.Unlock()
179 ccr.cc.updateResolverStateAndUnlock(s, nil)
180}
181
182// ParseServiceConfig is called by resolver implementations to parse a JSON
183// representation of the service config.

Callers

nothing calls this directly

Calls 5

addChannelzTraceEventMethod · 0.95
addressesToEndpointsFunction · 0.85
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected