(stopPicker *grpcsync.Event)
| 488 | } |
| 489 | |
| 490 | func (p *picker) start(stopPicker *grpcsync.Event) { |
| 491 | p.regenerateScheduler() |
| 492 | if len(p.weightedPickers) == 1 { |
| 493 | // No need to regenerate weights with only one backend. |
| 494 | return |
| 495 | } |
| 496 | |
| 497 | go func() { |
| 498 | ticker := time.NewTicker(time.Duration(p.cfg.WeightUpdatePeriod)) |
| 499 | defer ticker.Stop() |
| 500 | for { |
| 501 | select { |
| 502 | case <-stopPicker.Done(): |
| 503 | return |
| 504 | case <-ticker.C: |
| 505 | p.regenerateScheduler() |
| 506 | } |
| 507 | } |
| 508 | }() |
| 509 | } |
| 510 | |
| 511 | // endpointWeight is the weight for an endpoint. It tracks the SubConn that will |
| 512 | // be picked for the endpoint, and other parameters relevant to computing the |
no test coverage detected