Cache based on the localmemcache library which utilizes mmap to share strings in memory between ruby instances.
Wipe out all data in localmemcached, use with care.
# File lib/ramaze/cache/localmemcache.rb, line 30 def cache_clear @store.clear end
# File lib/ramaze/cache/localmemcache.rb, line 34 def cache_delete(*args) super { |key| @store.delete(key.to_s); nil } end
NOTE:
* We have no way of knowing whether the value really is nil, we assume you wouldn't cache nil and return the default instead.
# File lib/ramaze/cache/localmemcache.rb, line 41 def cache_fetch(*args) super { |key| value = @store[key.to_s] @serializer.load(value) if value } end
Connect to localmemcache
# File lib/ramaze/cache/localmemcache.rb, line 20 def cache_setup(host, user, app, name) @namespace = [host, user, app, name].compact.join('-') options = {:namespace => @namespace}.merge(OPTIONS) @serialize = options.delete(:serialize) @serializer = options.delete(:serializer) @store = ::LocalMemCache.new(options) end
Generated with the Darkfish Rdoc Generator 2.