Skip to content

Commit

Permalink
adds documentation about working with sentinel
Browse files Browse the repository at this point in the history
  • Loading branch information
leandromoreira committed Apr 18, 2015
1 parent 49c37e0 commit 3a43de8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ Or install it yourself as:
p second_try_lock_info
```

Redlock works seamlessly with [redis sentinel](http://redis.io/topics/sentinel), which is supported in redis 3.2+. It also allows clients to set any other arbitrary options on the Redis connection, e.g. password, driver, and more.

```ruby
servers = [ 'redis://localhost:6379', Redis.new(:url => 'redis://someotherhost:6379') ]
redlock = Redlock::Client.new(servers)
```

There's also a block version that automatically unlocks the lock:

```ruby
Expand Down

0 comments on commit 3a43de8

Please sign in to comment.