mewlo.mpacks.core.cache.mcache module

mcache.py Cache class.

class mewlo.mpacks.core.cache.mcache.MewloCacheManager(mewlosite, debugmode)[source]

Bases: mewlo.mpacks.core.manager.manager.MewloManager

Lightweight cache object that just wraps a 3rd party library. So this class just exposes an API, derived classes do the work.

addcache_region(key, regionobj)[source]

Add a region object to our dictionary cache.

convertregion(region)[source]

Return a region object – if a string is passed, look up the region by string.

description = 'Provides an API for cache system'
lookup_cachedregion(key)[source]

Lookup region in our dictionary cache.

regiondict = {}
typestr = 'core'
class mewlo.mpacks.core.cache.mcache.MewloCacheManager_DogPile(mewlosite, debugmode)[source]

Bases: mewlo.mpacks.core.cache.mcache.MewloCacheManager

Dogpile derived cache.

delete(region, key)[source]

Remove a value from the cache.

delete_multi(region, keys)[source]

Remove multiple values from the cache.

description = 'Provides an API for cache system, using Dogpile cache engine'
get(region, key, expiration_time=None, ignore_expiration=False)[source]

Return a value from the cache, based on the given key.

get_multi(region, keys, expiration_time=None, ignore_expiration=False)[source]

Return multiple values from the cache, based on the given keys.

get_or_create(region, key, creator, expiration_time=None, should_cache_fn=None)[source]

Return a cached value based on the given key.

get_or_create_multi(region, keys, creator, expiration_time=None, should_cache_fn=None)[source]

Return a sequence of cached values based on a sequence of keys.

getd(region, key, defaultval=None, expiration_time=None, ignore_expiration=False)[source]

Return a value from the cache, based on the given key.

invalidate(region, hard=True)[source]

Invalidate this CacheRegion.

is_emptyval(val)[source]
make_region(regionname)[source]
set(region, key, value)[source]

Place a new value in the cache under the given key.

set_multi(region, mapping)[source]

Place new values in the cache under the given keys.

startup_prep(stageid, eventlist)[source]

This is invoked by site strtup, for each stage specified in startup_stages_needed() above.

typestr = 'core'