caching¶
Utilities related to custom caches.
- class AsyncCache(max_size=128)[source]¶
Bases:
objectLRU cache implementation for coroutines.
Once the cache exceeds the maximum size, keys are deleted in FIFO order.
An offset may be optionally provided to be applied to the coroutine’s arguments when creating the cache key.
- __init__(max_size=128)[source]¶
Initialise a new
AsyncCacheinstance.- Parameters:
max_size (
int) – How many items to store in the cache.