throttle

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 3 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 {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New() *Throttle

func (*Throttle) Dec

func (t *Throttle) Dec(ops int) int

func (*Throttle) Delay

func (t *Throttle) Delay() time.Duration

func (*Throttle) Ops

func (t *Throttle) Ops() int

func (*Throttle) Update

func (t *Throttle) Update(ops int, until time.Time) *Throttle

func (*Throttle) Wait

func (t *Throttle) Wait(cxt context.Context) (int, int)

func (*Throttle) WaitN

func (t *Throttle) WaitN(cxt context.Context, ops int) (int, int)

Jump to

Keyboard shortcuts

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