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 CacheManager(ICacheManager): (source)

Constructor: CacheManager(app)

View In Hierarchy

Undocumented

Method __init__ Initialize the manager and resolve the active cache configuration.
Method _buildBackend Instantiate and return the raw backend for name.
Method _buildDatabaseBackend Instantiate and return the database cache backend.
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 by amount 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 and has not expired in the default store.
Async Method increment Increment the integer at key by amount in the default store.
Method lock Return an async context-manager lock for key on the default store.
Async Method pull Return and immediately delete key from the default store.
Async Method remember Return the cached value for key; resolve and cache if absent.
Async Method rememberForever Return the cached value for key; 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 CacheRepository for the named (or default) store.
Class Variable __slots__ Undocumented
Instance Variable _app Undocumented
Instance Variable _base_path Undocumented
Instance Variable _config Undocumented
Instance Variable _default Undocumented
Instance Variable _prefix Undocumented
Instance Variable _repositories Undocumented
def __init__(self, app: IApplication): (source)

Initialize the manager and resolve the active cache configuration.

Parameters
app:IApplicationApplication container used to read config and the base path.
Returns
NoneComplete the documented operation without returning a value.
def _buildBackend(self, name: str) -> Any: (source)

Instantiate and return the raw backend for name.

Parameters
name:strDriver name ('file', 'memory', 'redis', 'memcached').
Returns
AnyConfigured backend instance.
Raises
CacheStoreExceptionWhen name is 'redis' or 'memcached' but the store is not configured.
def _buildDatabaseBackend(self) -> Any: (source)

Instantiate and return the database cache backend.

Returns
AnyConfigured DatabaseCacheBackend instance.
Raises
CacheStoreExceptionWhen the database store is not configured.
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.
async def clear(self) -> bool: (source)

Remove all entries from the default store.

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

Decrement the integer at key by amount in the default store.

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

Remove key from the default store.

Parameters
key:strCache key.
Returns
boolTrue if the key existed, False otherwise.
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.
async def getMany(self, keys: list[str]) -> dict[str, Any]: (source)

Retrieve multiple values from the default store.

Parameters
keys:list[str]Cache keys to fetch.
Returns
dict[str, Any]Mapping of key → value; missing keys map to None.
async def has(self, key: str) -> bool: (source)

Check whether key exists and has not expired in the default store.

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

Increment the integer at key by amount in the default store.

Parameters
key:strCache key.
amount:intAmount to add.
Returns
intNew value after increment.
def lock(self, key: str, timeout: float | None = None) -> Any: (source)

Return an async context-manager lock for key on the default store.

Parameters
key:strResource key to lock.
timeout:float | NoneMaximum lock duration in seconds.
Returns
CacheLockAsync context manager.
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.
async def remember(self, key: str, ttl: float | None, resolver: Callable) -> Any: (source)

Return the cached value for key; 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.
async def rememberForever(self, key: str, resolver: Callable) -> Any: (source)

Return the cached value for key; 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.
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.
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.
def store(self, name: str | None = None) -> CacheRepository: (source)

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

The repository is created on first access and cached for reuse.

Parameters
name:str | NoneStore name ('file', 'memory', 'redis', 'memcached'). Defaults to the configured default store.
Returns
CacheRepositoryRepository for the selected backend.
Raises
CacheStoreExceptionWhen the requested store is not configured.
__slots__: tuple[str, ...] = (source)

Undocumented

Undocumented

_base_path: Path = (source)

Undocumented

Undocumented

_default: str = (source)

Undocumented

Undocumented

Undocumented