Documentation ¶
Overview ¶
Package redsync provides a Redis-based distributed mutual exclusion lock implementation as described in the post http://redis.io/topics/distlock.
Values containing the types defined in this package should not be copied.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFailed = errors.New("redsync: failed to acquire lock")
ErrFailed indicates error happened when acquire the lock
Functions ¶
This section is empty.
Types ¶
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
Mutex is a distributed mutual exclusion lock.
func (*Mutex) Extend ¶
Extend resets the mutex's expiry and returns the status of expiry extension. It is a run-time error if m is not locked on entry to Extend.
type Option ¶
type Option interface {
Apply(*Mutex)
}
An Option configures a mutex.
func SetDriftFactor ¶
SetDriftFactor can be used to set the clock drift factor.
func SetRetryDelay ¶
SetRetryDelay can be used to set the amount of time to wait between retries.
Click to show internal directories.
Click to hide internal directories.