MCPcopy Create free account
hub / github.com/astercloud/aster / ExponentialBackoffStrategy

Struct ExponentialBackoffStrategy

pkg/actor/supervisor.go:176–185  ·  view source on GitHub ↗

ExponentialBackoffStrategy 指数退避策略 重启间隔逐渐增加

Source from the content-addressed store, hash-verified

174// ExponentialBackoffStrategy 指数退避策略
175// 重启间隔逐渐增加
176type ExponentialBackoffStrategy struct {
177 InitialDelay time.Duration
178 MaxDelay time.Duration
179 MaxRestarts int
180 Decider Decider
181
182 mu sync.Mutex
183 currentDelay time.Duration
184 restartCount int
185}
186
187// NewExponentialBackoffStrategy 创建指数退避策略
188func NewExponentialBackoffStrategy(initialDelay, maxDelay time.Duration, maxRestarts int, decider Decider) *ExponentialBackoffStrategy {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected