package
1.2.4
Repository: https://github.com/ccheers/xpkg.git
Documentation: pkg.go.dev

# README

try_lock

import "github.com/ccheers/xpkg/sync/try_lock"

Index

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

# Interfaces

No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author