= Redis::Directory Redis::Directory assumes a Redis installation running on a default port and database 0 that will contain connection information for various other Redis databases. For example, if you were using a Redis database to store the content of cached pages, and this was running on a cluster of two Redis instances, with multiple applications connecting partitioned by database, then your connection might look like this: require "redis" require "redis/distributed" # The ACME Corp database is #27 cache = Redis::Distributed.new %w( redis://redis.example:4400/27 redis://redis.example:4401/27 ) Redis::Directory uses a centralized Redis database to store the connection information so you don't have to remember "magic numbers" for each client/database mapping, and can easily update port-numbers, hostnames and cluster-members as necessary. The same connection with Redis::Directory would look like this: require "redis_directory" cache = Redis::Directory.new("redis.example").get("cache", "acme")
Project
redis_directory
Redis::Directory assumes a Redis installation running on a default
port and database 0 that will contain connection information for various
other Redis databases. For example, if you were using a Redis database to
store the content of cached pages, and this was running on a cluster of
two Redis instances, with multiple applications connecting partitioned by
database, then your connection might look like this:
require "redis"
require "redis/distributed"
# The ACME Corp database is #27
cache = Redis::Distributed.new "redis://redis.example:4400/27", "redis://redis.example:4401/27"
Redis::Directory uses a centralized Redis database to store the
connection information so you don't have to remember "magic numbers" for
each client/database mapping, and can easily update port-numbers/hostnames,
cluster-members as necessary. The same connection with
Redis::Directory would look like this:
require "redis_directory"
cache = Redis::Directory.new("redis.example").connect("cache", "acme")
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
Development
Project Readme