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

Method NewClient

internal/xds/xdsclient/pool.go:117–119  ·  view source on GitHub ↗

NewClient returns an xDS client with the given name from the pool. If the client doesn't already exist, it creates a new xDS client and adds it to the pool. The second return value represents a close function which the caller is expected to invoke once they are done using the client. It is safe fo

(name string, metricsRecorder estats.MetricsRecorder)

Source from the content-addressed store, hash-verified

115// expected to invoke once they are done using the client. It is safe for the
116// caller to invoke this close function multiple times.
117func (p *Pool) NewClient(name string, metricsRecorder estats.MetricsRecorder) (XDSClient, func(), error) {
118 return p.newRefCounted(name, metricsRecorder, defaultWatchExpiryTimeout, nil)
119}
120
121// NewClientForTesting returns an xDS client configured with the provided
122// options from the pool. If the client doesn't already exist, it creates a new

Callers 5

TestClientNew_SingleMethod · 0.95
newCloudLoggingExporterFunction · 0.80
NewGRPCServerFunction · 0.80

Calls 1

newRefCountedMethod · 0.95