Sha256: 7f7a736f61086794d2a6a11d925b574654e8d897f8a631a6f649e444edb15055

Contents?: true

Size: 541 Bytes

Versions: 4

Compression:

Stored size: 541 Bytes

Contents

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

      def clear
        @client.delete(@key)
      end

      private

      def get
        @client.get_cas(@key)
      end

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

      def initial_set(val = BLANK_STR)
        @client.set(@key, val)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
suo-dependless-0.4.0 lib/suo/client/memcached.rb
suo-dependless-0.3.2 lib/suo/client/memcached.rb
suo-0.3.2 lib/suo/client/memcached.rb
suo-0.3.1 lib/suo/client/memcached.rb