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)
Click to show internal directories.
Click to hide internal directories.