Documentation ¶
Overview ¶
Synchronization built on top of Redis. Depends on github.com/garyburd/redigo/redis
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mutex ¶
type Mutex struct { // The key used in Redis. Name string // The amount of time before Redis will expire the lock. Ttl time.Duration // The time to sleep before retrying a lock attempt. Backoff time.Duration // contains filtered or unexported fields }
func NewMutex ¶
Each lock will have a name which corresponds to a key in the Redis server. The mutex will also be initialized with a uuid. The mutex uuid can be used to extend the TTL for the lock.
func (*Mutex) Lock ¶
With similar behaviour to Go's sync pkg, this function will sleep until TryLock() returns true. The connection will be used once to execute the lock script.
Click to show internal directories.
Click to hide internal directories.