Conservative redis based ruby distributed lock manager
This gem requires a running redis server and the redis ruby gem.
gem install dlm
or Gemfile
source 'https://rubygems.org'
gem 'dlm'
require 'dlm'
dlm = DLM.new
dlm.lock('test')
# do work here
dlm.unlock('test')
Use a custom Redis instance
require 'dlm'
dlm = DLM.new(Redis.new(url: 'redis://myredisserver'))
Reuse an existing Redis instance
require 'dlm'
redis = Redis.new(url: 'redis://myotherredis')
dlm = DLM.new(redis)
Sascha Spreitzer (c) 2018, MIT license