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

Method updateRunLocked

orca/producer.go:158–169  ·  view source on GitHub ↗

updateRunLocked is called whenever the run goroutine needs to be started / stopped / restarted due to: 1. the initial listener being registered, 2. the final listener being unregistered, or 3. the minimum registered interval changing.

()

Source from the content-addressed store, hash-verified

156// final listener being unregistered, or 3. the minimum registered interval
157// changing.
158func (p *producer) updateRunLocked() {
159 if p.stop != nil {
160 p.stop()
161 p.stop = nil
162 }
163 if len(p.listeners) > 0 {
164 var ctx context.Context
165 ctx, p.stop = context.WithCancel(context.Background())
166 p.stopped = make(chan struct{})
167 go p.run(ctx, p.stopped, p.minInterval)
168 }
169}
170
171// run manages the ORCA OOB stream on the subchannel.
172func (p *producer) run(ctx context.Context, done chan struct{}, interval time.Duration) {

Callers 2

registerListenerMethod · 0.95
unregisterListenerMethod · 0.95

Calls 2

runMethod · 0.95
stopMethod · 0.65

Tested by

no test coverage detected