RedisClusterMultilock
A multilock for redis cluster using lua scripts and given key(s) hopefully with shard key(s)
Installation
The package can be installed by adding redis_cluster_multilock to your list of dependencies in mix.exs:
def deps do
[
{:redis_cluster_multilock, "~> 0.1.0"}
]
endin config.exs
config :redis_cluster_multilock, :redis_cluster,
hosts: ["127.0.0.1"],
ports: [7001]-
Also an optional
pool_max_overflowandpool_sizewhich default to 5 and 20, respectively for the redis_cluster. For the application there'sdefault_life_mswhich defaults to 60000 anddefault_sleep_mswhich defaults to 125.
Information
- For keys being used please use a redis shard key that resolves to the same shard if giving many keys to lock see https://redis.io/topics/cluster-spec