Parent

Included Modules

Class Index [+]

Quicksearch

Ramaze::Cache::LocalMemCache

Cache based on the localmemcache library which utilizes mmap to share strings in memory between ruby instances.

Constants

OPTIONS

Public Instance Methods

cache_clear() click to toggle source

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
cache_delete(*args) click to toggle source
    # File lib/ramaze/cache/localmemcache.rb, line 34
34:       def cache_delete(*args)
35:         super { |key| @store.delete(key.to_s); nil }
36:       end
cache_fetch(*args) click to toggle source

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
cache_setup(host, user, app, name) click to toggle source

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
cache_store(*args) click to toggle source
    # File lib/ramaze/cache/localmemcache.rb, line 48
48:       def cache_store(*args)
49:         super { |key, value| @store[key.to_s] = @serializer.dump(value) }
50:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.