README.md in redlock-0.1.8 vs README.md in redlock-0.2.0
- old
+ new
@@ -6,13 +6,11 @@
[![Gem Version](https://badge.fury.io/rb/redlock.svg)](http://badge.fury.io/rb/redlock)
[![security](https://hakiri.io/github/leandromoreira/redlock-rb/master.svg)](https://hakiri.io/github/leandromoreira/redlock-rb/master)
[![Inline docs](http://inch-ci.org/github/leandromoreira/redlock-rb.svg?branch=master)](http://inch-ci.org/github/leandromoreira/redlock-rb)
[![Join the chat at https://gitter.im/leandromoreira/redlock-rb](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/leandromoreira/redlock-rb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-[![Codeship](https://codeship.com/projects/901ff180-c1ad-0132-1a88-3eb2295b72b3/status?branch=master)](https://codeship.com/projects/901ff180-c1ad-0132-1a88-3eb2295b72b3/status?branch=master)
-
# Redlock - A ruby distributed lock using redis.
> Distributed locks are a very useful primitive in many environments where different processes require to operate with shared resources in a mutually exclusive way.
>
> There are a number of libraries and blog posts describing how to implement a DLM (Distributed Lock Manager) with Redis, but every library uses a different approach, and many use a simple approach with lower guarantees compared to what can be achieved with slightly more complex designs.
@@ -120,9 +118,23 @@
end
rescue Redlock::LockError
# error handling
end
```
+
+It's possible to customize the retry logic providing the following options:
+
+```ruby
+ lock_manager = Redlock::Client.new(
+ servers, {
+ retry_count: 3,
+ retry_delay: 200, # milliseconds
+ retry_jitter: 50, # milliseconds
+ retry_timeout: 0.1 # seconds
+ })
+```
+
+For more information you can check [documentation](https://github.com/leandromoreira/redlock-rb/blob/master/lib/redlock/client.rb#L13-L20)
## Run tests
Make sure you have at least 1 redis instances up.