Documentation ¶
Overview ¶
Package gothrottler 用于控制 Goroutine 并发数
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Throttler ¶
type Throttler struct {
// contains filtered or unexported fields
}
Throttler goroutine 限流器
func (*Throttler) AddJob ¶
func (t *Throttler) AddJob(fn func(args ...interface{}), fnArgs ...interface{})
AddJob 添加一个任务
func (*Throttler) InterruptAndWait ¶
func (t *Throttler) InterruptAndWait()
InterruptAndWait 取消还没有执行的任务,清空任务列队,并等待正在执行的任务完成
Click to show internal directories.
Click to hide internal directories.