ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

class ICacheManager(ABC): (source)

Known subclasses: orionis.cache.CacheManager

View In Hierarchy

Undocumented

Async Method add Store value only if key is absent in the default store.
Async Method clear Remove all entries from the default store.
Async Method decrement Decrement the integer at key in the default store.
Async Method delete Remove key from the default store.
Async Method get Retrieve the value for key from the default store.
Async Method getMany Retrieve multiple values from the default store.
Async Method has Check whether key exists in the default store.
Async Method increment Increment the integer at key in the default store.
Async Method pull Return and immediately delete key from the default store.
Async Method remember Return the cached value; resolve and cache if absent.
Async Method rememberForever Return the cached value; resolve and cache forever if absent.
Async Method set Store value under key in the default store.
Async Method setMany Store multiple key/value pairs in the default store.
Method store Return the repository for the named (or default) store.
@abstractmethod
async def add(self, key: str, value: Any, ttl: float | None = None) -> bool: (source)

Store value only if key is absent in the default store.

Parameters
key:strCache key.
value:AnyValue to store.
ttl:float | NoneOptional TTL in seconds.
Returns
boolTrue on success, False when the key already exists.
@abstractmethod
async def clear(self) -> bool: (source)

Remove all entries from the default store.

Returns
boolTrue on success.
@abstractmethod
async def decrement(self, key: str, amount: int = 1) -> int: (source)

Decrement the integer at key in the default store.

Parameters
key:strCache key.
amount:intAmount to subtract.
Returns
intNew value after decrement.
@abstractmethod
async def delete(self, key: str) -> bool: (source)

Remove key from the default store.

Parameters
key:strCache key.
Returns
boolTrue if the key existed.
@abstractmethod
async def get(self, key: str) -> Any: (source)

Retrieve the value for key from the default store.

Parameters
key:strCache key.
Returns
AnyCached value, or None when absent.
@abstractmethod
async def getMany(self, keys: list[str]) -> dict[str, Any]: (source)

Retrieve multiple values from the default store.

Parameters
keys:list[str]Cache keys.
Returns
dict[str, Any]Mapping of key → value.
@abstractmethod
async def has(self, key: str) -> bool: (source)

Check whether key exists in the default store.

Parameters
key:strCache key.
Returns
boolTrue if present and valid.
@abstractmethod
async def increment(self, key: str, amount: int = 1) -> int: (source)

Increment the integer at key in the default store.

Parameters
key:strCache key.
amount:intAmount to add.
Returns
intNew value after increment.
@abstractmethod
async def pull(self, key: str) -> Any: (source)

Return and immediately delete key from the default store.

Parameters
key:strCache key.
Returns
AnyCached value, or None when absent.
@abstractmethod
async def remember(self, key: str, ttl: float | None, resolver: Callable) -> Any: (source)

Return the cached value; resolve and cache if absent.

Parameters
key:strCache key.
ttl:float | NoneTTL applied when caching the resolved value.
resolver:CallableZero-argument callable (sync or async) producing the value.
Returns
AnyCached or freshly computed value.
@abstractmethod
async def rememberForever(self, key: str, resolver: Callable) -> Any: (source)

Return the cached value; resolve and cache forever if absent.

Parameters
key:strCache key.
resolver:CallableZero-argument callable (sync or async) producing the value.
Returns
AnyCached or freshly computed value.
@abstractmethod
async def set(self, key: str, value: Any, ttl: float | None = None) -> bool: (source)

Store value under key in the default store.

Parameters
key:strCache key.
value:AnyValue to cache.
ttl:float | NoneTime-to-live in seconds. None means no expiry.
Returns
boolTrue on success.
@abstractmethod
async def setMany(self, values: dict[str, Any], ttl: float | None = None) -> bool: (source)

Store multiple key/value pairs in the default store.

Parameters
values:dict[str, Any]Mapping of key → value.
ttl:float | NoneShared TTL in seconds.
Returns
boolTrue on success.
@abstractmethod
def store(self, name: str | None = None) -> ICacheRepository: (source)

Return the repository for the named (or default) store.

Parameters
name:str | NoneStore name. None selects the configured default.
Returns
ICacheRepositoryRepository bound to the requested store.