Documentation ¶
Index ¶
Constants ¶
View Source
const ( Running = iota Pending Over Idle )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseLimiter ¶
type BaseLimiter struct {
// contains filtered or unexported fields
}
type GuardPool ¶
type GuardPool struct { RunningSheet map[string]*GoWorker IdleSheet map[string]*GoWorker RunningChan chan *GoWorker IdleChan chan *GoWorker StatusChan chan *GoWorker TaskFuncChan chan TaskFunc // contains filtered or unexported fields }
func (*GuardPool) AsyncSubmit ¶
func (*GuardPool) GetRunningCount ¶
type IntervalLimiter ¶
type IntervalLimiter struct { BaseLimiter // contains filtered or unexported fields }
func NewIntervalLimiter ¶
func NewIntervalLimiter(interval time.Duration) *IntervalLimiter
type TempoLimiter ¶
type TempoLimiter struct { Limit int32 SecondSpan int32 BaseLimiter // contains filtered or unexported fields }
func NewTempoLimit ¶
func NewTempoLimit(limit, second int32) *TempoLimiter
func (*TempoLimiter) Hit ¶
func (t *TempoLimiter) Hit() bool
Click to show internal directories.
Click to hide internal directories.