Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomControllerRateLimiter ¶
func CustomControllerRateLimiter(qps int, bucketNum int) workqueue.RateLimiter
Types ¶
type GoRoutineExecutor ¶
type GoRoutineExecutor struct { TaskID string GoRoutineFunc GoRoutineParams []interface{} }
GoRoutineExecutor body
type GoRoutineFunc ¶
type GoRoutineFunc func(params ...interface{}) (interface{}, error)
GoRoutineFunc process func
type GoRoutinePool ¶
type GoRoutinePool struct {
// contains filtered or unexported fields
}
GoRoutinePool go routine pool
func NewRateLimitedGoRoutinePool ¶
func NewRateLimitedGoRoutinePool(size int, stopCH <-chan struct{}, ctx context.Context, qps int, bucketNum int) *GoRoutinePool
NewRateLimitedGoRoutinePool bucketNum 默认最好为1, 这样qps才会准确
func (*GoRoutinePool) Submit ¶
func (p *GoRoutinePool) Submit(executor GoRoutineExecutor)
Submit task
Click to show internal directories.
Click to hide internal directories.