README.md in redis-3.1.0 vs README.md in redis-3.2.0

- old
+ new

@@ -83,10 +83,38 @@ All commands, their arguments and return values are documented, and available on [rdoc.info][rdoc]. [rdoc]: http://rdoc.info/github/redis/redis-rb/ +## Sentinel support + +The client is able to perform automatic failovers by using [Redis +Sentinel](http://redis.io/topics/sentinel). Make sure to run Redis 2.8+ +if you want to use this feature. + +To connect using Sentinel, use: + +```ruby +SENTINELS = [{:host => "127.0.0.1", :port => 26380}, + {:host => "127.0.0.1", :port => 26381}] + +redis = Redis.new(:url => "redis://mymaster", :sentinels => SENTINELS, :role => :master) +``` + +* The master name identifies a group of Redis instances composed of a master +and one or more slaves (`mymaster` in the example). + +* It is possible to optionally provide a role. The allowed roles are `master` +and `slave`. When the role is `slave`, the client will try to connect to a +random slave of the specified master. + +* When using the Sentinel support you need to specify a list of sentinels to +connect to. The list does not need to enumerate all your Sentinel instances, +but a few so that if one is down the client will try the next one. The client +is able to remember the last Sentinel that was able to reply correctly and will +use it for the next requests. + ## Storing objects Redis only stores strings as values. If you want to store an object, you can use a serialization mechanism such as JSON: @@ -164,10 +192,10 @@ from sharing a socket with its parent; this is potentially useful in order to mitigate connection churn when: - many short-lived forked children of one process need to talk to redis, AND - your own code prevents the parent process from using the redis connection while a child is alive - + Improper use of `inherit_socket` will result in corrupted and/or incorrect responses. ## Alternate drivers