# README
try_lock
import "github.com/ccheers/xpkg/sync/try_lock"
Index
- func SimpleDistributedTryLock(command CASCommand, key string, duration time.Duration, opts ...Option) (func(), error)
- type CASCommand
- type Option
- type Schedule
- type TryMutexLocker
func SimpleDistributedTryLock
func SimpleDistributedTryLock(command CASCommand, key string, duration time.Duration, opts ...Option) (func(), error)
type CASCommand
type CASCommand interface {
CAS(key, src, dst string) bool
}
type Option
type Option func(*options)
func WithScheduleFunc
func WithScheduleFunc(f func()) Option
type Schedule
type Schedule func()
type TryMutexLocker
type TryMutexLocker interface {
Unlock()
TryLock(duration time.Duration) error
}
func NewChMutex
func NewChMutex() TryMutexLocker
func NewDistributedTryLocker
func NewDistributedTryLocker(cmd CASCommand, key, value string, opts ...Option) TryMutexLocker
Generated by gomarkdoc
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author