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

Method Build

orca/producer.go:40–56  ·  view source on GitHub ↗

Build constructs and returns a producer and its cleanup function

(cci any)

Source from the content-addressed store, hash-verified

38
39// Build constructs and returns a producer and its cleanup function
40func (*producerBuilder) Build(cci any) (balancer.Producer, func()) {
41 p := &producer{
42 client: v3orcaservicegrpc.NewOpenRcaServiceClient(cci.(grpc.ClientConnInterface)),
43 intervals: make(map[time.Duration]int),
44 listeners: make(map[OOBListener]struct{}),
45 backoff: internal.DefaultBackoffFunc,
46 }
47 return p, func() {
48 p.mu.Lock()
49 if p.stop != nil {
50 p.stop()
51 p.stop = nil
52 }
53 p.mu.Unlock()
54 <-p.stopped
55 }
56}
57
58var producerBuilderSingleton = &producerBuilder{}
59

Callers

nothing calls this directly

Calls 3

stopMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected