Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LockManager ¶
type LockManager struct {
// contains filtered or unexported fields
}
func New ¶
func New(r *redis.Client) *LockManager
func (*LockManager) GetLock ¶
func (m *LockManager) GetLock(name string, lockDuration, maxWaitTime time.Duration) (isSuccessful bool, token string)
lockDuration = the total effective period for the lock waitTime = if the lock is already hold by someone, the period of time that current thread should wait for
func (*LockManager) ReleaseLock ¶
func (m *LockManager) ReleaseLock(name, token string)
Click to show internal directories.
Click to hide internal directories.