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()
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
have environment variable
REDIS_CONFIG_STR = 127.0.0.1:6379,100,password,0,30 (see above redis_config_string)