Documentation
¶
Index ¶
- Variables
- type Mutex
- type MutexOption
- type MutexOptionFunc
- type Semaphore
- type SemaphoreOption
- func WithSemaphoreDeleteTimeout(deleteTimeout time.Duration) SemaphoreOption
- func WithSemaphoreMutexExpiry(mutexExpiry time.Duration) SemaphoreOption
- func WithSemaphoreMutexName(mutexName string) SemaphoreOption
- func WithSemaphoreMutexTimeout(mutexTimeout time.Duration) SemaphoreOption
- func WithSemaphorePollDur(pollDur time.Duration) SemaphoreOption
- func WithSemaphoreQueueKeysByPrio(queueKeysByPrio ...string) SemaphoreOption
- type SemaphoreOptionFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoKeysLeft = errors.New("error: no keys left in queues")
View Source
var ErrTimeout = errors.New("error: lock timeout")
Functions ¶
This section is empty.
Types ¶
type Mutex ¶ added in v0.0.6
func NewMutex ¶ added in v0.0.6
func NewMutex(redisClient redis.UniversalClient, name string, opts ...MutexOption) Mutex
type MutexOption ¶ added in v0.0.6
type MutexOption interface {
Apply(*mutex)
}
func WithMutexExpiry ¶
func WithMutexExpiry(expiry time.Duration) MutexOption
func WithMutexPollDur ¶ added in v0.0.6
func WithMutexPollDur(pollDur time.Duration) MutexOption
func WithMutexTimeout ¶ added in v0.0.6
func WithMutexTimeout(timeout time.Duration) MutexOption
type MutexOptionFunc ¶ added in v0.0.6
type MutexOptionFunc func(*mutex)
func (MutexOptionFunc) Apply ¶ added in v0.0.6
func (f MutexOptionFunc) Apply(m *mutex)
type Semaphore ¶
type Semaphore interface { Acquire(ctx context.Context, key string) error Release(ctx context.Context, key string) error AcquireQueue(ctx context.Context, queue, key string) error ReleaseQueue(ctx context.Context, queue, key string) error }
func NewSemaphore ¶
func NewSemaphore(redisClient redis.UniversalClient, name string, size int, opts ...SemaphoreOption) (Semaphore, error)
type SemaphoreOption ¶ added in v0.0.6
type SemaphoreOption interface {
Apply(*semaphore)
}
func WithSemaphoreDeleteTimeout ¶ added in v0.0.6
func WithSemaphoreDeleteTimeout(deleteTimeout time.Duration) SemaphoreOption
func WithSemaphoreMutexExpiry ¶ added in v0.0.6
func WithSemaphoreMutexExpiry(mutexExpiry time.Duration) SemaphoreOption
func WithSemaphoreMutexName ¶ added in v0.0.6
func WithSemaphoreMutexName(mutexName string) SemaphoreOption
func WithSemaphoreMutexTimeout ¶ added in v0.0.6
func WithSemaphoreMutexTimeout(mutexTimeout time.Duration) SemaphoreOption
func WithSemaphorePollDur ¶ added in v0.0.6
func WithSemaphorePollDur(pollDur time.Duration) SemaphoreOption
func WithSemaphoreQueueKeysByPrio ¶ added in v0.0.6
func WithSemaphoreQueueKeysByPrio(queueKeysByPrio ...string) SemaphoreOption
type SemaphoreOptionFunc ¶ added in v0.0.6
type SemaphoreOptionFunc func(*semaphore)
func (SemaphoreOptionFunc) Apply ¶ added in v0.0.6
func (f SemaphoreOptionFunc) Apply(s *semaphore)
Click to show internal directories.
Click to hide internal directories.