Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanSemaphore ¶
type ChanSemaphore struct {
// contains filtered or unexported fields
}
Semaphore 限制同一时刻,最多可以发生的次数
func (*ChanSemaphore) Acquire ¶
func (this *ChanSemaphore) Acquire()
func (*ChanSemaphore) Release ¶
func (this *ChanSemaphore) Release()
type SleepLimiter ¶
SleepLimiter 限制单位时间内的可执行次数
func NewSleepLimiter ¶
func NewSleepLimiter(ttl time.Duration, limit int) *SleepLimiter
func (*SleepLimiter) Acquire ¶
func (this *SleepLimiter) Acquire()
Click to show internal directories.
Click to hide internal directories.