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 ISessionStore(ABC): (source)
Known subclasses: orionis.session.stores.cache.CacheSessionStore, orionis.session.stores.database.DatabaseSessionStore, orionis.session.stores.file.FileSessionStore, orionis.session.stores.memory.MemorySessionStore
Contract every session backing-store must satisfy.
Responsibilities
- Persist and retrieve SessionRecord objects.
- Remove records on demand.
- Reject updates to absent or expired records atomically.
- Collect expired records via gc().
The store is not responsible for:
- Knowing about Request or Response.
- Generating session identifiers.
- Creating Session objects.
- Choosing the lifetime duration (the manager does that).
| Async Method | delete |
Remove the record for session_id; a no-op when absent. |
| Async Method | gc |
Remove all records whose expires_at is in the past. |
| Async Method | read |
Return the stored record for session_id, or None. |
| Async Method | update |
Update a live session atomically without creating a missing record. |
| Async Method | write |
Persist record, creating or overwriting the existing entry. |
| Class Variable | __slots__ |
Undocumented |
overridden in
orionis.session.stores.cache.CacheSessionStore, orionis.session.stores.database.DatabaseSessionStore, orionis.session.stores.file.FileSessionStore, orionis.session.stores.memory.MemorySessionStoreRemove all records whose expires_at is in the past.
| Returns | |
None | Undocumented |
overridden in
orionis.session.stores.cache.CacheSessionStore, orionis.session.stores.database.DatabaseSessionStore, orionis.session.stores.file.FileSessionStore, orionis.session.stores.memory.MemorySessionStoreReturn 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. |
overridden in
orionis.session.stores.cache.CacheSessionStore, orionis.session.stores.database.DatabaseSessionStore, orionis.session.stores.file.FileSessionStore, orionis.session.stores.memory.MemorySessionStoreUpdate a live session atomically without creating a missing record.
| Parameters | |
record:SessionRecord | Replacement session payload and expiration. |
| Returns | |
bool | True only when a live record was updated. Deletion or expiry must win over a stale request's write, including across workers. |
overridden in
orionis.session.stores.cache.CacheSessionStore, orionis.session.stores.database.DatabaseSessionStore, orionis.session.stores.file.FileSessionStore, orionis.session.stores.memory.MemorySessionStorePersist record, creating or overwriting the existing entry.
| Parameters | |
record:SessionRecord | The record to store. |
| Returns | |
None | Undocumented |