MCPcopy
hub / github.com/grafana/dskit / New

Function New

backoff/backoff.go:35–42  ·  view source on GitHub ↗

New creates a Backoff object. Pass a Context that can also terminate the operation.

(ctx context.Context, cfg Config)

Source from the content-addressed store, hash-verified

33
34// New creates a Backoff object. Pass a Context that can also terminate the operation.
35func New(ctx context.Context, cfg Config) *Backoff {
36 return &Backoff{
37 cfg: cfg,
38 ctx: ctx,
39 nextDelayMin: cfg.MinBackoff,
40 nextDelayMax: doubleDuration(cfg.MinBackoff, cfg.MaxBackoff),
41 }
42}
43
44// Reset the Backoff back to its initial condition
45func (b *Backoff) Reset() {

Callers 13

waitBeforeJoiningMethod · 0.92
WaitInstanceStateFunction · 0.92
WatchKeyMethod · 0.92
WatchPrefixMethod · 0.92
WatchKeyMethod · 0.92
WatchPrefixMethod · 0.92
watchBeaconsMethod · 0.92
newBackoffRetryFunction · 0.92
NewRateLimitRetrierFunction · 0.92
TestBackoff_NextDelayFunction · 0.70

Calls 1

doubleDurationFunction · 0.85

Tested by 3

newBackoffRetryFunction · 0.74
TestBackoff_NextDelayFunction · 0.56