initPrewarm 会为规则中的每个目标开启后台保温。
(rule *config.Rule)
| 34 | // tracks the small, bounded number of concurrent dials. |
| 35 | type prewarmPool struct { |
| 36 | manager *prewarmManager |
| 37 | addr string |
| 38 | desired int |
| 39 | |
| 40 | ctx context.Context |
| 41 | cancel context.CancelFunc |
| 42 | wake chan struct{} |
| 43 | dial func(context.Context, string) (net.Conn, error) |
| 44 | wg sync.WaitGroup |
| 45 | |
| 46 | mu sync.Mutex |
| 47 | idle []idlePrewarmConn |
no test coverage detected