Sha256: 556fe0429627240575ca9c23ae54825fb4ff74bc34362917dba7f62ddb883e6c

Contents?: true

Size: 404 Bytes

Versions: 4

Compression:

Stored size: 404 Bytes

Contents

begin
  require 'dalli'
rescue LoadError
  raise LoadError, ":memcached store requires the dalli gem to be installed."
end

class Rack::PageSpeed::Store::Memcached
  def initialize *args
    @client = Dalli::Client.new *args
    # @client.stats # let it raise errors if it can't connect
  end
  
  def [] key
    @client.get key
  end
  
  def []= key, value
    @client.set key, value
    true
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
rack-pagespeed-fork-0.1.1 lib/rack/pagespeed/store/memcached.rb
rack-pagespeed-fork-0.1.0 lib/rack/pagespeed/store/memcached.rb
rack-pagespeed-1.1.2 lib/rack/pagespeed/store/memcached.rb
rack-pagespeed-1.1.1 lib/rack/pagespeed/store/memcached.rb