Skip to content

Commit

Permalink
Update document of NewExponentialBackoffManager
Browse files Browse the repository at this point in the history
  • Loading branch information
ah8ad3 committed May 15, 2024
1 parent bb3030b commit 94f76f4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions staging/src/k8s.io/apimachinery/pkg/util/wait/backoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,20 +337,20 @@ type exponentialBackoffManagerImpl struct {
//
// Instead of:
//
// bm := wait.NewExponentialBackoffManager(init, max, reset, factor, jitter, clock)
// bm := wait.NewExponentialBackoffManager(initBackoff, maxBackoff, resetDuration, backoffFactor, jitter, clock)
// ...
// wait.BackoffUntil(..., bm.Backoff, ...)
//
// Use:
//
// delayFn := wait.Backoff{
// Duration: init,
// Cap: max,
// Duration: initBackoff,
// Cap: maxBackoff,
// Steps: int(math.Ceil(float64(max) / float64(init))), // now a required argument
// Factor: factor,
// Factor: backoffFactor,
// Jitter: jitter,
// }.DelayWithReset(reset, clock)
// wait.BackoffUntil(..., delayFn.Timer(), ...)
// }.DelayWithReset(clock, resetDuration)
// delayFn.Until(...)
func NewExponentialBackoffManager(initBackoff, maxBackoff, resetDuration time.Duration, backoffFactor, jitter float64, c clock.Clock) BackoffManager {
return &exponentialBackoffManagerImpl{
backoff: &Backoff{
Expand Down

0 comments on commit 94f76f4

Please sign in to comment.