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.
Resolve configured cache stores and reuse their repositories.
| Method | __init__ |
Initialize the manager and resolve the active cache configuration. |
| Method | _build |
Instantiate and return the raw backend for name. |
| Method | _build |
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 | get |
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 | remember |
Return the cached value for key; resolve and cache forever if absent. |
| Async Method | remember |
Coalesce misses in the default store with explicit admission bounds. |
| Async Method | set |
Store value under key in the default store. |
| Async Method | set |
Store multiple key/value pairs in the default store. |
| Method | store |
Return the named or default cache repository. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _app |
Application container used to read config and the base path. |
| Instance Variable | _base |
Base path obtained from app.basePath. |
| Instance Variable | _config |
Validated configuration used to construct and operate the service. |
| Instance Variable | _default |
Value used when the client omits this argument. |
| Instance Variable | _prefix |
Prefix applied when constructing names or storage keys. |
| Instance Variable | _repositories |
Cache repositories already resolved, indexed by store name. |
| Instance Variable | _repositories |
Serialize initial repository construction across calling threads. |
Initialize the manager and resolve the active cache configuration.
| Parameters | |
app:orionis.IApplication | Application container used to read config and the base path. |
| Returns | |
None | No return value. |
Instantiate and return the raw backend for name.
| Parameters | |
name:str | Driver name: file, memory, Redis, Memcached or database. |
| Returns | |
typing.Any | Configured backend instance. |
| Raises | |
orionis.cache.exceptions.CacheStoreException | When name is 'redis' or 'memcached' but the store is not configured. |
Instantiate and return the database cache backend.
| Returns | |
typing.Any | Configured orionis.cache.stores.database.DatabaseCacheBackend
instance. |
| Raises | |
orionis.cache.exceptions.CacheStoreException | When the database store is not configured. |
Store value only if key is absent in the default store.
| Parameters | |
key:str | Cache key. |
value:typing.Any | Value to store. |
ttl:float | None | Optional TTL in seconds. |
| Returns | |
bool | True on success, False when the key already exists. |
Retrieve the value for key from the default store.
| Parameters | |
key:str | Cache key. |
| Returns | |
typing.Any | Cached value, or None when absent. |
Retrieve multiple values from the default store.
| Parameters | |
keys:list[str] | Cache keys to fetch. |
| Returns | |
dict[str, typing.Any] | Mapping of key → value; missing keys map to None. |
Return an async context-manager lock for key on the default store.
| Parameters | |
key:str | Resource key to lock. |
timeout:float | None | Store-specific acquisition deadline or lease duration in seconds. None leaves file/database acquisition unbounded and uses the default lease for database and aiocache backends. |
| Returns | |
orionis.cache.locks.lock.CacheLock | Async context manager. |
Return and immediately delete key from the default store.
| Parameters | |
key:str | Cache key. |
| Returns | |
typing.Any | Cached value, or None when absent. |
Return the cached value for key; resolve and cache if absent.
| Parameters | |
key:str | Cache key. |
ttl:float | None | TTL applied when caching the resolved value. |
resolver:collections.abc.Callable | Zero-argument callable (sync or async) producing the value. |
| Returns | |
typing.Any | Cached or freshly computed value. |
Return the cached value for key; resolve and cache forever if absent.
| Parameters | |
key:str | Cache key. |
resolver:collections.abc.Callable | Zero-argument callable (sync or async) producing the value. |
| Returns | |
typing.Any | Cached or freshly computed value. |
Self, key: str, ttl: float | None, resolver: Callable, *, wait_timeout: float = 10, lease: float | None = None) -> Any:
(source)
¶
Coalesce misses in the default store with explicit admission bounds.
| Parameters | |
key:str | Cache key. |
ttl:float | None | Result lifetime according to the selected backend. |
resolver:collections.abc.Callable | Zero-argument synchronous or asynchronous producer. |
waitfloat | Maximum seconds waiting for the current local resolver. |
lease:float | None | Optional backend lock lease; backend lock guarantees apply. |
| Returns | |
typing.Any | Shared result, including None for overlapping calls. |
Store value under key in the default store.
| Parameters | |
key:str | Cache key. |
value:typing.Any | Value to cache. |
ttl:float | None | Time-to-live in seconds. None means no expiry. |
| Returns | |
bool | True on success. |
Store multiple key/value pairs in the default store.
| Parameters | |
values:dict[str, typing.Any] | Mapping of key → value. |
ttl:float | None | Shared TTL in seconds. |
| Returns | |
bool | True on success. |
Return the named or default cache repository.
The repository is created once on first access, including concurrent callers from different threads, and cached for reuse.
| Parameters | |
name:str | None | Store name: file, memory, Redis, Memcached or database. Defaults to the configured default store. |
| Returns | |
orionis.cache.CacheRepository | Repository for the selected backend. |
| Raises | |
orionis.cache.exceptions.CacheStoreException | When the requested store is not configured. |