redis_mutex.cr
redis_mutex
Distributed mutex in Ruby using Redis.
Somewhat redis-mutex clone. The idea was taken from the official SETNX doc.
Installation
Add this to your application's shard.yml
:
dependencies:
redis_mutex:
github: Schniz/redis_mutex.cr
and have Redis installed
Usage
require "redis_mutex"
RedisMutex::Lock.run("SOME_KEY", 2.seconds) do
puts "This code runs and waits until unlock with maximum time of 2 seconds lock"
end
Contributing
- Fork it ( https://github.com/Schniz/redis_mutex.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- Schniz Gal Schlezinger - creator, maintainer
Repository
redis_mutex.cr
Owner
Statistic
- 1
- 3
- 0
- 0
- 1
- about 7 years ago
- October 23, 2017
License
MIT License
Links
Synced at
Mon, 18 Nov 2024 02:45:17 GMT
Languages