Sha256: 7dfeb7168a1799aabd4bf647c8cbdcb617c62494dd7f264b7e428d442f09f536

Contents?: true

Size: 534 Bytes

Versions: 1

Compression:

Stored size: 534 Bytes

Contents

module Suo
  module Client
    class Memcached < Base
      def initialize(options = {})
        options[:client] ||= Dalli::Client.new(options[:connection] || ENV["MEMCACHE_SERVERS"] || "127.0.0.1:11211")
        super
      end

      def clear(key)
        @client.delete(key)
      end

      private

      def get(key)
        @client.get_cas(key)
      end

      def set(key, newval, cas)
        @client.set_cas(key, newval, cas)
      end

      def initial_set(key)
        @client.set(key, "")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
suo-0.2.1 lib/suo/client/memcached.rb