Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
Lock is a Redis lock
type LockController ¶
type LockController struct {
// contains filtered or unexported fields
}
LockController is for extend the lock every heartbeat period it allows kill the server and don't wait releasing the lock a long time
func NewController ¶
func NewController(lockName string, heartbeatPeriod time.Duration, lockExtender LockExtender) *LockController
func (*LockController) Close ¶
func (c *LockController) Close()
func (*LockController) StartHeartbeat ¶
func (c *LockController) StartHeartbeat()
StartHeartbeat starts a goroutine for extending the lock
type LockExtender ¶
type LockFactory ¶
type LockFactory struct {
// contains filtered or unexported fields
}
LockFactory is a Redis based LockFactory
func NewLockFactory ¶
NewLockFactory returns configured Redis based LockFactory
func (*LockFactory) CreateLock ¶
func (lf *LockFactory) CreateLock(name string) locks.Lock
CreateLock returns lock instance (not yet locked)
type LocksCloser ¶
type LocksCloser struct {
// contains filtered or unexported fields
}
LocksCloser is designer for graceful closing all locks on server shutdown
func NewLocksCloser ¶
func NewLocksCloser() *LocksCloser
func (*LocksCloser) Close ¶
func (lc *LocksCloser) Close() error
func (*LocksCloser) Remove ¶
func (lc *LocksCloser) Remove(identifier string)
Click to show internal directories.
Click to hide internal directories.