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

Method Build

balancer/leastrequest/leastrequest.go:88–97  ·  view source on GitHub ↗
(cc balancer.ClientConn, bOpts balancer.BuildOptions)

Source from the content-addressed store, hash-verified

86}
87
88func (bb) Build(cc balancer.ClientConn, bOpts balancer.BuildOptions) balancer.Balancer {
89 b := &leastRequestBalancer{
90 ClientConn: cc,
91 endpointRPCCounts: resolver.NewEndpointMap[*atomic.Int32](),
92 }
93 b.child = endpointsharding.NewBalancer(b, bOpts, balancer.Get(pickfirst.Name).Build, endpointsharding.Options{})
94 b.logger = internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf("[%p] ", b))
95 b.logger.Infof("Created")
96 return b
97}
98
99type leastRequestBalancer struct {
100 // Embeds balancer.ClientConn because we need to intercept UpdateState

Callers

nothing calls this directly

Calls 4

NewEndpointMapFunction · 0.92
NewBalancerFunction · 0.92
GetFunction · 0.92
InfofMethod · 0.65

Tested by

no test coverage detected