# Functions
ExponentialBackoff strategy is an optimization strategy with a retry time of 2**n milliseconds (n means number of times).
LimitRetry limits the number of retries to max attempts.
LinearBackoff allows retries regularly with customized intervals.
New creates a new Client instance with a custom namespace.
NewClient 推荐链接格式 &redis.Options{
Addr: "127.0.0.1:6379",
Password: "hello", // no password set
db: 0, // use default db
PoolSize: 100,
MinIdleConns: 50,
}
*/.
NoRetry acquire the lock only once.
Obtain is a short-cut for New(...).Obtain(...).
TryLock exp(ttl time).
# Variables
ErrLockNotHeld is returned when trying to release an inactive lock.
ErrNotObtained is returned when a lock cannot be obtained.
No description provided by the author
# Interfaces
RedisClient is a minimal client interface.
RetryStrategy allows to customise the lock retry strategy.
# Type aliases
No description provided by the author