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 CacheSessionStore(ISessionStore): (source)
Constructor: CacheSessionStore(cache, store)
Session store backed by the framework's cache system.
Each session is persisted as a single cache entry whose TTL mirrors record.expires_at. Expiry is therefore delegated entirely to the underlying cache backend (file, database, Redis, ...); no in-process bookkeeping or manual sweeping is required.
Notes
ICacheManager exposes no way to enumerate stored keys, so this
store cannot (and does not need to) implement an active gc:
the backend evicts expired entries on its own.
| Method | __init__ |
Bind the store to the requested (or default) cache repository. |
| Async Method | delete |
Remove the record for session_id (no-op when absent). |
| Async Method | gc |
No-op: expiry is enforced natively by the cache backend's TTL. |
| Async Method | read |
Return the stored record for session_id, or None. |
| Async Method | update |
Replace a live cache session without recreating a missing key. |
| Async Method | write |
Insert or replace the record keyed by its identifier. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _repository |
Undocumented |
Bind the store to the requested (or default) cache repository.
| Parameters | |
cache:ICacheManager | The application's cache manager. |
store:str | None, optional | Name of the cache store to use. None selects the configured default store. |
| Returns | |
None | Undocumented |
Return the stored record for session_id, or None.
| Parameters | |
sessionstr | Unique session identifier to look up. |
| Returns | |
SessionRecord | None | The stored record, or None when absent or expired. |
Replace a live cache session without recreating a missing key.
| Parameters | |
record:SessionRecord | Replacement record. |
| Returns | |
bool | Whether the cache atomically replaced a live record. |
Insert or replace the record keyed by its identifier.
The cache entry's TTL is derived from record.expires_at; a record that has already expired is deleted instead of written.
| Parameters | |
record:SessionRecord | The record to persist. |
| Returns | |
None | Undocumented |