Class: DistributedMarshaledRedis

Inherits:
DistRedis
  • Object
show all
Defined in:
lib/redis/distributed_marshaled_redis.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(addresses) ⇒ DistributedMarshaledRedis

Returns a new instance of DistributedMarshaledRedis.



4
5
6
7
8
9
# File 'lib/redis/distributed_marshaled_redis.rb', line 4

def initialize(addresses)
  nodes = addresses.map do |address|
    MarshaledRedis.new address
  end
  @ring = Redis::HashRing.new nodes
end

Instance Attribute Details

#ringObject (readonly)

Returns the value of attribute ring.



2
3
4
# File 'lib/redis/distributed_marshaled_redis.rb', line 2

def ring
  @ring
end

Instance Method Details

#nodesObject



11
12
13
# File 'lib/redis/distributed_marshaled_redis.rb', line 11

def nodes
  ring.nodes
end