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 ¶
var ErrFailed = errors.New("redsync: failed to acquire lock")
Functions ¶
This section is empty.
Types ¶
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
A Mutex is a distributed mutual exclusion lock.
func (*Mutex) Lock ¶
Lock locks m. In case it returns an error on failure, you may retry to acquire the lock by calling this method again.
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 SetGenValueFunc ¶
SetGenValueFunc can be used to set the custom value generator.
func SetRetryDelay ¶
SetRetryDelay can be used to set the amount of time to wait between retries.
func SetRetryDelayFunc ¶
SetRetryDelayFunc can be used to override default delay behavior.