Class: Redis::DistributedMarshaled

Inherits:
Distributed
  • Object
show all
Defined in:
lib/redis/distributed_marshaled.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(addresses) ⇒ DistributedMarshaled

Returns a new instance of DistributedMarshaled.



5
6
7
8
9
10
# File 'lib/redis/distributed_marshaled.rb', line 5

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

Instance Attribute Details

#ringObject (readonly)

Returns the value of attribute ring.



3
4
5
# File 'lib/redis/distributed_marshaled.rb', line 3

def ring
  @ring
end

Instance Method Details

#nodesObject



12
13
14
# File 'lib/redis/distributed_marshaled.rb', line 12

def nodes
  ring.nodes
end