memory¶
- class litestar.stores.memory.MemoryStore[source]¶
Bases:
StoreIn memory, atomic, asynchronous key/value store.
- __init__() None[source]¶
Initialize
MemoryStore
- async set(key: str, value: str | bytes, expires_in: int | timedelta | None = None) None[source]¶
Set a value.
- async get(key: str, renew_for: int | timedelta | None = None) bytes | None[source]¶
Get a value.
- Parameters:
- Returns:
The value associated with
keyif it exists and is not expired, elseNone
- async delete(key: str) None[source]¶
Delete a value.
If no such key exists, this is a no-op.
- Parameters:
key¶ – Key of the value to delete