locker

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace string = "_Locker"
)

Variables

View Source
var (
	ErrStatusBusy = errors.New("status busy")
)

Functions

func MutexLock

func MutexLock(lockID string, ttl int32, backend Backend) error

func MutexTryLock

func MutexTryLock(lockID string, ttl int32, deadline int64, backend Backend) bool

func MutexUnlock

func MutexUnlock(lockID string, backend Backend) error

Types

type Backend

type Backend interface {
	Get(key []byte) (*store.Value, error)
	TrySetWithTTL(key, value []byte, ttl uint32) error
	Del(key []byte) error
	Watch(key []byte) (notify store.WatcherNotify, err error)
}

Jump to

Keyboard shortcuts

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