async-lru
async-lru copied to clipboard
Simple LRU cache for asyncio
Bumps [coverage](https://github.com/nedbat/coveragepy) from 7.6.1 to 7.6.3. Changelog Sourced from coverage's changelog. Version 7.6.3 — 2024-10-13 Fix: nested context managers could incorrectly be analyzed to flag a missing branch on the...
It appears that the `alru_cache` decorator is using an unsynchronized `OrderedDict` instance for its cache: https://github.com/aio-libs/async-lru/blob/dc601e2b288336f4511e3ec1afad22cf7b0ab04e/async_lru/__init__.py#L103 If I am not mistaken, that will lead to a data race if the...
It will be a great feature to add a "jitter" parameter that can be used for TTL to apply each action. "Jitter" will increment TTL by a random value between...
I'm looking for an equivalent to a feature like [this](https://stackoverflow.com/questions/30730983/make-lru-cache-ignore-some-of-the-function-arguments) from the `cachetools` library. For instance, an app could use multiple DB connections to fetch the same data, even though...
This fixes something I broke in my previous PR. ## What do these changes do? We must use the private `_exception` attribute instead of `exception()` so asyncio does not set...
This PR just microoptimizes attribute lookups in `_LRUCacheWrapper.__call__` to streamline call speed ## Checklist - [x] I think the code is well written - [x] Unit tests for the changes...
## What do these changes do? This should be faster on the benchmarks, not sure though. ## Are there changes in behavior for the user? None ## Related issue number...
This gets rid of the unnecessary use of functools.partial in the task done callback As the callback is a private method, there are no changes in behavior for the end...
## What do these changes do? If a cache wrapper does not have a maxsize, there isn't any reason to reorganize the OrderedDict. Let's wait until the codspeed stuff is...
This PR just microoptimizes attribute lookups in `_LRUCacheWrapper._task_done_callback` to streamline call speed. ## Checklist - [x] I think the code is well written - [x] Unit tests for the changes...