README.md in redlock-1.1.0 vs README.md in redlock-1.2.0
- old
+ new
@@ -1,13 +1,11 @@
-[![Stories in Ready](https://badge.waffle.io/leandromoreira/redlock-rb.png?label=ready&title=Ready)](https://waffle.io/leandromoreira/redlock-rb)
[![Build Status](https://travis-ci.org/leandromoreira/redlock-rb.svg?branch=master)](https://travis-ci.org/leandromoreira/redlock-rb)
[![Coverage Status](https://coveralls.io/repos/leandromoreira/redlock-rb/badge.svg?branch=master)](https://coveralls.io/r/leandromoreira/redlock-rb?branch=master)
[![Code Climate](https://codeclimate.com/github/leandromoreira/redlock-rb/badges/gpa.svg)](https://codeclimate.com/github/leandromoreira/redlock-rb)
[![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)
# 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.
@@ -135,9 +133,17 @@
retry_count: 3,
retry_delay: 200, # milliseconds
retry_jitter: 50, # milliseconds
redis_timeout: 0.1 # seconds
})
+```
+
+It is possible to associate `:retry_delay` option with `Proc` object. It will be called every time, with attempt number
+as argument, to get delay time value before next retry.
+
+```ruby
+retry_delay = proc { |attempt_number| 200 * attempt_number ** 2 } # delay of 200ms for 1st retry, 800ms for 2nd retry, etc.
+lock_manager = Redlock::Client.new(servers, retry_delay: retry_delay)
```
For more information you can check [documentation](http://www.rubydoc.info/gems/redlock/Redlock%2FClient:initialize).
## Run tests