throttle

package
v1.1.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Throttle

type Throttle struct {
	CheckInterval int64
	NumSamples    int64
	Target        int64
	// contains filtered or unexported fields
}

Throttle implements generic Throttler

func New

func New(target int64, checkInterval int64, numSamples int64) *Throttle

New creates new Throttler

func (*Throttle) Advice

func (t *Throttle) Advice(add int64) int64

Advice return a sleep advice to satisfy throttling requirements

func (*Throttle) Close

func (t *Throttle) Close()

Close releases resources

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL