Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientQueryLimiter ¶
type ClientQueryLimiter struct {
// contains filtered or unexported fields
}
func NewClientQueryLimiter ¶
func NewClientQueryLimiter(maxQueries int) *ClientQueryLimiter
func (*ClientQueryLimiter) Acquire ¶
func (l *ClientQueryLimiter) Acquire(key string) bool
func (*ClientQueryLimiter) Done ¶
func (l *ClientQueryLimiter) Done(key string)
type ConcurrentLimiter ¶
type ConcurrentLimiter struct {
// contains filtered or unexported fields
}
ConcurrentLimiter is a soft limiter.
func NewConcurrentLimiter ¶
func NewConcurrentLimiter(max int) *ConcurrentLimiter
NewConcurrentLimiter returns a ConcurrentLimiter, max must > 0.
func (*ConcurrentLimiter) Available ¶
func (l *ConcurrentLimiter) Available() int
func (*ConcurrentLimiter) Done ¶
func (l *ConcurrentLimiter) Done()
func (*ConcurrentLimiter) Max ¶
func (l *ConcurrentLimiter) Max() int
func (*ConcurrentLimiter) Running ¶
func (l *ConcurrentLimiter) Running() int32
func (*ConcurrentLimiter) Wait ¶
func (l *ConcurrentLimiter) Wait() chan<- struct{}
Click to show internal directories.
Click to hide internal directories.