Async cachetools decorators with stampede protection.
Project description
acachetools provides asyncio-compatible versions of cachetools.cached() and cachetools.cachedmethod(). Concurrent calls for the same cache key share a single in-flight computation, preventing cache stampedes.
Installation
pip install acachetools
Usage
from cachetools import TTLCache
from acachetools import cached
# Compatible with TTLCache, LRUCache, LFUCache, RRCache, etc.
@cached(cache=TTLCache(maxsize=1024, ttl=600))
async def foo(bar: int):
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
acachetools-0.1.0.tar.gz
(2.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file acachetools-0.1.0.tar.gz.
File metadata
- Download URL: acachetools-0.1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dfcd71a099b18d65c047e9e31622b950a5fbaf66c1f27972db32eb4594556c7
|
|
| MD5 |
640df6fc50935c3e9622066f7f56745e
|
|
| BLAKE2b-256 |
17a83991586fb09149853f31cade621ab00b24f3b106f9f5ad3ff81074108142
|
File details
Details for the file acachetools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: acachetools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5534dda4d6564baabf6931776f17ac959976a5fc4e5d82c3d68c6e258df2cf05
|
|
| MD5 |
9157b1aab42a5ed11d7441ee0a82bdde
|
|
| BLAKE2b-256 |
82f7e3a21062555b366209005c5e2ba130eac20845ca4e8c1eb629b13a9da99d
|