Releases: EzyGang/py-cachify
Releases · EzyGang/py-cachify
Release list
v3.1.0
Release Notes
3.1.0
Features & Enhancements
Resource Pools:
- New
pool()class for managing concurrent execution slots withmax_sizelimit. - Use as context manager:
async with pool(key='worker-pool', max_size=10) - Use as decorator via
@pooled(key='...', max_size=N, on_full=callback) on_fullcallback receives same*args, **kwargsas wrapped function, enabling rescheduling, logging, or fallback logic.raise_on_full=Trueoption to raiseCachifyPoolFullErrorinstead of calling on_full.slot_expparameter for slot TTL (defaults todefault_pool_slot_expirationfrominit_cachify(), default 600 seconds).size()andasize()methods to check current pool occupancy.- New
CachifyPoolFullErrorexception exported frompy_cachify.
Configurable lock polling interval:
init_cachifynow accepts alock_poll_intervalparameter (default:0.1seconds).- This controls how frequently the library polls for lock availability when
nowait=False. - Lower values make lock acquisition more responsive but increase load on the cache backend.
- Higher values reduce backend load but may increase wait times.
Thread-safe async memory cache:
- The in-memory async cache wrapper (
AsyncWrapper) now uses anasyncio.Lockto protect concurrent access. - This prevents race conditions when multiple async tasks access the same in-memory cache simultaneously.
Improvements
- Minor code cleanup in
MemoryCache.delete()for better efficiency.
Github provided changes
What's Changed
- chore: migrate from mypy to pyright, update github actions, bumpdependencies by @Galtozzy in #227
- feat: add configurable lock poll interval and thread-safe async cache by @Galtozzy in #228
- feat(pool): add rate limiting pool support by @Galtozzy in #229
Full Changelog: v3.0.1...v3.1.0
v3.0.0
What's Changed
- feat: provide an ability to create more than one instance of py-cachify per a single app by @Galtozzy in #210
- feat: make locks correct to avoid some of the race conditions by @Galtozzy in #211
- feat: add default cache ttl to init_cachify by @Galtozzy in #212
Full release notes and migration guide: here
Potentially breaking changes:
- Python 3.8 support dropped.
- Deprecated aliases removed (
async_cached,async_once,sync_cached,sync_once). - Custom clients have to respect
nxparameter insetoperations. If you used Redis/DragonflyDB or in-memory only, everything will continue working as is.
Full Changelog: v2.1.1...v3.0.0
v2.1.1
v2.1.0
v2.0.10
v2.0.9
v2.0.8
v2.0.7
What's Changed
- Bump pytest from 8.3.3 to 8.3.4 by @dependabot in #156
- Bump ruff from 0.7.3 to 0.8.1 by @dependabot in #154
- Bump taskipy from 1.14.0 to 1.14.1 by @dependabot in #155
- Bump mkdocs-material from 9.5.44 to 9.5.47 by @dependabot in #153
- Add python3.13 support by @Galtozzy in #158
New Contributors
- @dependabot made their first contribution in #156
Full Changelog: v2.0.4...v2.0.7