Skip to content

gabynaiman/redic-sentinels

Repository files navigation

Redic::Sentinels

Gem Version Build Status Coverage Status Code Climate

Redic::Sentinels is a wrapper for the Redis client that fetches configuration details from sentinels.

Based on soveran/redisent

Installation

Add this line to your application's Gemfile:

gem 'redic-sentinels'

And then execute:

$ bundle

Or install it yourself as:

$ gem install redic-sentinels

Usage

hosts = [
  'localhost:26379',
  'localhost:26380',
  'localhost:26381'
]

redis = Redic::Sentinels.new hosts: hosts, 
                             master_name: 'mymaster', 
                             db: 1, # optional (default: 0)
                             password: 'pass', # optional
                             max_retries: 5 # optional (default: 3): Number of attempts to reconnect to master

redis.call 'PING' # => 'PONG'

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/gabynaiman/redic-sentinels.

License

The gem is available as open source under the terms of the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages