ratelimiter

package
v0.0.0-...-1369677 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FanIn  = 1 << 0
	FanOut = 1 << 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimiter

type RateLimiter interface {
	Push(t worker.Task) bool  // 提供给生产者推送数据
	Pop() (worker.Task, bool) // 提供给消费者消费数据
	Close() error             // 关闭限流器
}

func NewRateLimiter

func NewRateLimiter(size, rate int64, mode int) (RateLimiter, error)

Jump to

Keyboard shortcuts

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