base_impl
CacheStoreImpl
from dara.core.internal.cache_store.base_impl import CacheStoreImpl
class CacheStoreImpl(abc.ABC, Generic[PolicyT])
Methods
delete
@abc.abstractmethod
async def delete(key: str) -> Any
Delete an entry from the cache.
Arguments:
key
: The key of the entry to delete.
get
@abc.abstractmethod
async def get(key: str, unpin: bool = False) -> Any
Retrieve an entry from the cache.
Arguments:
key
: The key of the entry to retrieve.unpin
: If true, the entry will be unpinned if it is pinned.
set
@abc.abstractmethod
async def set(key: str, value: Any, pin: bool = False)
Add an entry to the cache. Depending on the implementation might evict other entries.
Arguments:
key
: The key of the entry to set.value
: The value of the entry to set.pin
: If true, the entry will not be evicted until read.
clear
@abc.abstractmethod
async def clear()
Empty the store.