Parent

Redis::DistributedStore

Attributes

ring[R]

Public Class Methods

new(addresses, options = { }) click to toggle source
# File lib/redis/distributed_store.rb, line 8
def initialize(addresses, options = { })
  nodes = addresses.map do |address|
    ::Redis::Store.new _merge_options(address, options)
  end

  _extend_namespace options
  @ring = Redis::HashRing.new nodes
end

Public Instance Methods

get(key, options = nil) click to toggle source
# File lib/redis/distributed_store.rb, line 29
def get(key, options = nil)
  node_for(key).get(key, options)
end
nodes() click to toggle source
# File lib/redis/distributed_store.rb, line 17
def nodes
  ring.nodes
end
reconnect() click to toggle source
# File lib/redis/distributed_store.rb, line 21
def reconnect
  nodes.each {|node| node.reconnect }
end
set(key, value, options = nil) click to toggle source
# File lib/redis/distributed_store.rb, line 25
def set(key, value, options = nil)
  node_for(key).set(key, value, options)
end
setnx(key, value, options = nil) click to toggle source
# File lib/redis/distributed_store.rb, line 33
def setnx(key, value, options = nil)
  node_for(key).setnx(key, value, options)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.