rate

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter interface {
	Allow()
}

Limiter provides only one function: Allow. it blocks until routine can proceed

func BurstyLimiter

func BurstyLimiter(period time.Duration, requestsPerPeriod int) Limiter

BurstyLimiter will create a limiter which allows bursts of maximum requestsPerPeriod and otherwise allows requests with period/requestsPerPeriod gap in between

Jump to

Keyboard shortcuts

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