cache Package

cache Package

_memcache_pool Module

core Module

Keystone Caching Layer Implementation.

class keystone.common.cache.core.DebugProxy(*args, **kwargs)[source]

Bases: dogpile.cache.proxy.ProxyBackend

Extra Logging ProxyBackend.

delete(key)[source]
delete_multi(keys)[source]
get(key)[source]
get_multi(keys)[source]
set(key, value)[source]
set_multi(keys)[source]
keystone.common.cache.core.build_cache_config()[source]

Build the cache region dictionary configuration.

Parameters:conf – configuration object for keystone
Returns:dict
keystone.common.cache.core.configure_cache_region(region)[source]

Configure a cache region.

Parameters:region – optional CacheRegion object, if not provided a new region will be instantiated
Raises :exception.ValidationError
Returns:dogpile.cache.CacheRegion
keystone.common.cache.core.function_key_generator(namespace, fn, to_str=<function key_generate_to_str at 0x7fb3cea48c08>)[source]
keystone.common.cache.core.key_generate_to_str(s)[source]
keystone.common.cache.core.should_cache_fn(section)[source]

Build a function that returns a config section’s caching status.

For any given driver in keystone that has caching capabilities, a boolean config option for that driver’s section (e.g. token) should exist and default to True. This function will use that value to tell the caching decorator if caching for that driver is enabled. To properly use this with the decorator, pass this function the configuration section and assign the result to a variable. Pass the new variable to the caching decorator as the named argument should_cache_fn. e.g.:

from keystone.common import cache

SHOULD_CACHE = cache.should_cache_fn('token')

@cache.on_arguments(should_cache_fn=SHOULD_CACHE)
def function(arg1, arg2):
    ...
Parameters:section (string) – name of the configuration section to examine
Returns:function reference

Table Of Contents

Previous topic

common Package

Next topic

backends Package

This Page