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 ICacheRepository(ABC): (source)
Known subclasses: orionis.cache.CacheRepository
Define the contract for cache repository implementations.
| Async Method | add |
Store value only if key does not already exist. |
| Async Method | clear |
Remove all entries from the store. |
| Async Method | decrement |
Decrement the integer stored at key by amount. |
| Async Method | delete |
Remove key from the store. |
| Async Method | get |
Retrieve the cached value for key. |
| Async Method | get |
Retrieve multiple values at once. |
| Async Method | has |
Check whether key exists and has not expired. |
| Async Method | increment |
Increment the integer stored at key by amount. |
| Async Method | pull |
Return and immediately delete key from the store. |
| Async Method | remember |
Return the cached value; resolve and cache if absent. |
| Async Method | remember |
Return the cached value; resolve and cache forever if absent. |
| Async Method | remember |
Coalesce overlapping misses, or explicitly reject unsupported stores. |
| Async Method | replace |
Replace a live entry atomically without creating a missing key. |
| Async Method | set |
Store value under key with an optional TTL. |
| Async Method | set |
Store multiple key/value pairs with an optional TTL. |
| Class Variable | __slots__ |
Declare that this class introduces no additional instance slots. |
Self, key: str, value: Any, ttl: float | None = None) -> bool:
(source)
¶
orionis.cache.CacheRepositoryStore value only if key does not already exist.
| 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. |
orionis.cache.CacheRepositoryRemove all entries from the store.
| Returns | |
bool | True on success. |
orionis.cache.CacheRepositoryRetrieve the cached value for key.
| Parameters | |
key:str | Cache key. |
| Returns | |
typing.Any | Cached value, or None when absent. |
orionis.cache.CacheRepositoryRetrieve multiple values at once.
| Parameters | |
keys:list[str] | Cache keys. |
| Returns | |
dict[str, typing.Any] | Mapping of key → value; missing keys map to None. |
orionis.cache.CacheRepositoryReturn and immediately delete key from the store.
| Parameters | |
key:str | Cache key. |
| Returns | |
typing.Any | Cached value, or None when absent. |
Self, key: str, ttl: float | None, resolver: Callable) -> Any:
(source)
¶
orionis.cache.CacheRepositoryReturn the cached value; 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. |
Self, key: str, resolver: Callable) -> Any:
(source)
¶
orionis.cache.CacheRepositoryReturn the cached value; 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)
¶
orionis.cache.CacheRepositoryCoalesce overlapping misses, or explicitly reject unsupported stores.
| Parameters | |
key:str | Cache or lease key to access. |
ttl:float | None | Entry lifetime in seconds. |
resolver:collections.abc.Callable | Callback that supplies the missing cache value. |
waitfloat | Maximum number of seconds to wait for ownership. |
lease:float | None | Lease lifetime in seconds; use the store default when omitted. |
| Returns | |
typing.Any | Cached value or the result produced by the owning resolver. |
Self, key: str, value: Any, ttl: float | None = None) -> bool:
(source)
¶
orionis.cache.CacheRepositoryReplace a live entry atomically without creating a missing key.
| Parameters | |
key:str | Cache key that must already exist. |
value:typing.Any | Replacement value. |
ttl:float | None | New lifetime in seconds, or None for no expiry. |
| Returns | |
bool | True when replaced; False when missing, expired or superseded. |
Self, key: str, value: Any, ttl: float | None = None) -> bool:
(source)
¶
orionis.cache.CacheRepositoryStore value under key with an optional TTL.
| 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. |
Self, values: dict[ str, Any], ttl: float | None = None) -> bool:
(source)
¶
orionis.cache.CacheRepositoryStore multiple key/value pairs with an optional TTL.
| Parameters | |
values:dict[str, typing.Any] | Mapping of key → value. |
ttl:float | None | Shared TTL in seconds. |
| Returns | |
bool | True on success. |
orionis.cache.CacheRepositoryDeclare that this class introduces no additional instance slots.