simplelock

package module
v0.0.0-...-f3ee0e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2017 License: GPL-3.0 Imports: 2 Imported by: 0

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL