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