Documentation ¶
Index ¶
Constants ¶
View Source
const LOCK_DEL = `
if redis.call("GET", KEYS[1]) == ARGV[1] then
return redis.call("DEL", KEYS[1])
else
return 0
end`
Variables ¶
This section is empty.
Functions ¶
func SetDefault ¶
func SetDefault(rcli *redis.Client, cfgs ...Config)
Types ¶
type CancelFunc ¶
type CancelFunc func() bool
func TryAcquire ¶
func TryAcquire(lockName string, expire time.Duration) (bool, CancelFunc)
type Rlock ¶
type Rlock struct { Config // contains filtered or unexported fields }
var ( DefaultInstance *Rlock LockInterval = time.Millisecond * 4 )
func (*Rlock) TryAcquire ¶
Click to show internal directories.
Click to hide internal directories.