lock

package
v0.0.0-...-261bb52 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 4 Imported by: 0

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 锁对象

func TryLock

func TryLock(conn *redis.Client, resource string, token string) (*Lock, bool, error)

TryLock 尝试加锁

func TryLockWithTimeout

func TryLockWithTimeout(conn *redis.Client, resource string, token string, timeout time.Duration) (*Lock, bool, error)

TryLockWithTimeout 尝试加锁

func WaitingGetLock

func WaitingGetLock(conn *redis.Client, resource string, token string) (*Lock, error)

WaitingGetLock 等待加锁

func (*Lock) Unlock

func (lock *Lock) Unlock() error

Unlock 放弃锁

Jump to

Keyboard shortcuts

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