Sha256: a1525688e1e554411a1d9af8c2eeadf6e7c3d66fcf14db9f41932b7abb1a3bae

Contents?: true

Size: 624 Bytes

Versions: 2

Compression:

Stored size: 624 Bytes

Contents

class Redis
  class DistributedMarshaled < Distributed
    attr_reader :ring

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

    def nodes
      ring.nodes
    end

    def marshalled_set(key, val, options = nil)
      node_for(key).marshalled_set(key, val, options)
    end

    def marshalled_get(key, options = nil)
      node_for(key).marshalled_get(key, options)
    end

    def marshalled_setnx(key, value, options = nil)
      node_for(key).marshalled_setnx(key, value, options)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redis-store-1.0.0.beta2 lib/redis/distributed_marshaled.rb
redis-store-1.0.0.beta1 lib/redis/distributed_marshaled.rb