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 30: def cache_clear 31: @store.clear 32: end
# File lib/ramaze/cache/localmemcache.rb, line 34 34: def cache_delete(*args) 35: super { |key| @store.delete(key.to_s); nil } 36: 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 41: def cache_fetch(*args) 42: super { |key| 43: value = @store[key.to_s] 44: @serializer.load(value) if value 45: } 46: end
Connect to localmemcache
# File lib/ramaze/cache/localmemcache.rb, line 20 20: def cache_setup(host, user, app, name) 21: @namespace = [host, user, app, name].compact.join('-') 22: options = {:namespace => @namespace}.merge(OPTIONS) 23: 24: @serialize = options.delete(:serialize) 25: @serializer = options.delete(:serializer) 26: @store = ::LocalMemCache.new(options) 27: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.