MemoryCacher
- class coba.context.MemoryCacher
A cacher that caches in memory.
Constructors
- __init__() None
Instantiate a MemoryCacher.
Methods
- get_set(key: _K, getter: Callable[[], _V] | _V) ContextManager[_V]
Get a key from the cache.
If the key is not in the cache put it first using getter.
- Parameters:
key – The key to get from the cache.
getter – A method for getting the value if necessary.
- rmv(key: _K) None
Remove a key from the cache.
- Parameters:
key – The key to remove from the cache.