Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLimited = errors.New("limit exceeded")
ErrLimited limited error for non-blocking
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
type Limiter interface { // returns how many holder are running // return -1 if u donot want to implement this Running() int // Acquire by this keys, returns error if no available resource // Panic if key is unhashable type necessarily Acquire(keys ...interface{}) error // Release this keys holder // Panic if not acquire yet necessarily // Panic if key is unhashable type necessarily Release(keys ...interface{}) }
Limiter to limit all by key
type ResettableLimiter ¶
ResettableLimiter resetable limiter
Click to show internal directories.
Click to hide internal directories.