semaphore

package
v0.0.0-...-872e689 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 (sema *Semaphore) AcquireCounterSemaphoreWithLock(key string, limit int64) (string, bool)

func (*Semaphore) AcquireUnfairCounterSemaphore

func (sema *Semaphore) AcquireUnfairCounterSemaphore(key string, limit int64) (string, error)

func (*Semaphore) ReleaseCounterSemaphoreWithLock

func (sema *Semaphore) ReleaseCounterSemaphoreWithLock(key string, identifire string) bool

func (*Semaphore) ReleaseUnfairCounterSemaphore

func (sema *Semaphore) ReleaseUnfairCounterSemaphore(key string, identifire string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL