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 MemorySessionStore(ISessionStore): (source)

Constructor: MemorySessionStore()

View In Hierarchy

In-process session store backed by a plain dictionary.

Suitable for development and testing. The internal dictionary is instance-scoped: separate instances never share state.

Notes

Thread safety is not guaranteed. Use this store only in single- threaded event-loop environments (the standard asyncio model).

Method __init__ Initialise an empty in-memory session store.
Async Method delete Remove the record for session_id (no-op when absent).
Async Method gc Evict all records whose expires_at is in the past.
Async Method read Return the stored record for session_id, or None.
Async Method update Replace a live record without yielding between checking and writing.
Async Method write Insert or replace the record keyed by its identifier.
Class Variable __slots__ Undocumented
Instance Variable _storage Undocumented
def __init__(self): (source)

Initialise an empty in-memory session store.

Returns
NoneUndocumented
async def delete(self, session_id: str) -> bool: (source)

Remove the record for session_id (no-op when absent).

Parameters
session_id:strUnique session identifier to remove.
Returns
boolTrue only when a stored record was removed.
async def gc(self): (source)

Evict all records whose expires_at is in the past.

Collects expired keys before mutating the dictionary to avoid modifying a collection during iteration.

Returns
NoneUndocumented
async def read(self, session_id: str) -> SessionRecord | None: (source)

Return the stored record for session_id, or None.

Parameters
session_id:strUnique session identifier to look up.
Returns
SessionRecord | NoneThe stored record, or None when absent.
async def update(self, record: SessionRecord) -> bool: (source)

Replace a live record without yielding between checking and writing.

Parameters
record:SessionRecordReplacement record.
Returns
boolWhether a live session still existed at the time of the update.
async def write(self, record: SessionRecord): (source)

Insert or replace the record keyed by its identifier.

Parameters
record:SessionRecordThe record to persist.
Returns
NoneUndocumented

Undocumented