Documentation ¶
Index ¶
- type Semaphore
- func (sema *Semaphore) AcquireCounterSemaphoreWithLock(key string, limit int64) (string, bool)
- func (sema *Semaphore) AcquireUnfairCounterSemaphore(key string, limit int64) (string, error)
- func (sema *Semaphore) ReleaseCounterSemaphoreWithLock(key string, identifire string) bool
- func (sema *Semaphore) ReleaseUnfairCounterSemaphore(key string, identifire string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Semaphore ¶
type Semaphore struct {
Client *redis.Client
}
func NewSemaphore ¶
func NewSemaphore() *Semaphore
func (*Semaphore) AcquireCounterSemaphoreWithLock ¶
func (*Semaphore) AcquireUnfairCounterSemaphore ¶
func (*Semaphore) ReleaseCounterSemaphoreWithLock ¶
func (*Semaphore) ReleaseUnfairCounterSemaphore ¶
Click to show internal directories.
Click to hide internal directories.