Cache

class amari.cache.Cache(ttl: int, maxbytes: int = 25600)[source]

Bases: object

A simple LRU cache with TTL and size limit.

ttl

Time to live for cache entries, in seconds.

Type:

int

maxbytes

Maximum total size of cached data in bytes.

Type:

int

__init__(ttl: int, maxbytes: int = 25600)[source]
async get(key: Tuple) Any | None[source]
async set(key: Tuple, data: Any)[source]