Skip to content
ws6Public

About

a redis backend distributed lock

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

dlock

package is meant shared by all subpackages with distributed lock needs.

The current implementation of dlock is backing on redis.
Algo/protocol - https://redis.io/topics/distlock
Golang implementation - https://github.com/go-redsync/redsync
!!! We repurpose this library so we assume the lock is unlimited for current lock without explicitly calling Extend()

configuration

redis_config_string = the redisgo style configuration string
addr,pool size,password,dbnum,IdleTimeout second
e.g.
127.0.0.1:6379,100,password,0,30
or
127.0.0.1:6379 without password
except addr, the other configuration is optional
default poolSize= 100
default dbnum = 0
default IdelTimeout Second = 0
default password is empty

expire_second = the redis key expiry seconds. defalt 15
num_retry = number of retry when acquiring a lock. default 10

test setup

have environment variable
REDIS_CONFIG_STR = 127.0.0.1:6379,100,password,0,30 (see above redis_config_string)

About

a redis backend distributed lock

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

⌂ 换网址