MCPcopy Create free account
hub / github.com/cppla/moto / initPrewarm

Function initPrewarm

controller/prewarm.go:36–44  ·  view source on GitHub ↗

initPrewarm 会为规则中的每个目标开启后台保温。

(rule *config.Rule)

Source from the content-addressed store, hash-verified

34// tracks the small, bounded number of concurrent dials.
35type 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

Callers 1

ListenFunction · 0.85

Calls 1

ensurePrewarmPoolFunction · 0.85

Tested by

no test coverage detected