class CacheImpl: (source)
Known subclasses: mako.ext.beaker_cache.BeakerCacheImpl
, mako.testing.fixtures.PlainCacheImpl
Provide a cache implementation for use by :class:`.Cache`.
Method | __init__ |
Undocumented |
Method | get |
Retrieve a value from the cache. |
Method | get |
Retrieve a value from the cache, using the given creation function to generate a new value. |
Method | invalidate |
Invalidate a value in the cache. |
Method | set |
Place a value in the cache. |
Class Variable | pass |
If ``True``, the :class:`.Context` will be passed to :meth:`get_or_create <.CacheImpl.get_or_create>` as the name ``'context'``. |
Instance Variable | cache |
Undocumented |
Retrieve a value from the cache. :param key: the value's key. :param \**kw: cache configuration arguments.
Retrieve a value from the cache, using the given creation function to generate a new value. This function *must* return a value, either from the cache, or via the given creation function. If the creation function is called, the newly created value should be populated into the cache under the given key before being returned. :param key: the value's key. :param creation_function: function that when called generates a new value. :param \**kw: cache configuration arguments.
Invalidate a value in the cache. :param key: the value's key. :param \**kw: cache configuration arguments.
Place a value in the cache. :param key: the value's key. :param value: the value. :param \**kw: cache configuration arguments.