Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backoff ¶
type Backoff struct { // Factor is the multiplying factor for each increment step Factor float64 // Jitter eases contention by randomizing backoff steps Jitter bool // Min and Max are the minimum and maximum values of the counter Min, Max time.Duration // contains filtered or unexported fields }
Backoff is an exponential counter, it starts from `Min` duration, and after every call to `Duration` method the duration will be multiplied by `Factor`, but it never exceeds `Max`. Backoff is not thread-safe.
func NewBackoff ¶
NewBackoff creates a new backoff instance.
func (*Backoff) BoundaryForward ¶
func (b *Backoff) BoundaryForward()
BoundaryForward checks whether `Current` reaches `Max` duration, if not then increases the cwnd counter, else does nothing.
func (*Backoff) Current ¶
Current returns the duration for the current cwnd, but doesn't increase the cwnd counter.
Click to show internal directories.
Click to hide internal directories.