Skip to content

Releases: EzyGang/py-cachify

v3.1.0

Choose a tag to compare

@Galtozzy Galtozzy released this 08 Apr 13:21
b04a589

Release Notes

3.1.0

Features & Enhancements

Resource Pools:

  • New pool() class for managing concurrent execution slots with max_size limit.
  • 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_full callback receives same *args, **kwargs as wrapped function, enabling rescheduling, logging, or fallback logic.
  • raise_on_full=True option to raise CachifyPoolFullError instead of calling on_full.
  • slot_exp parameter for slot TTL (defaults to default_pool_slot_expiration from init_cachify(), default 600 seconds).
  • size() and asize() methods to check current pool occupancy.
  • New CachifyPoolFullError exception exported from py_cachify.

Configurable lock polling interval:

  • init_cachify now accepts a lock_poll_interval parameter (default: 0.1 seconds).
  • 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 an asyncio.Lock to 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

Choose a tag to compare

@Galtozzy Galtozzy released this 13 Dec 19:46

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 nx parameter in set operations. 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

Choose a tag to compare

@Galtozzy Galtozzy released this 09 Oct 16:16

What's Changed

Full Changelog: v2.1.0...v2.1.1

v2.1.0

Choose a tag to compare

@Galtozzy Galtozzy released this 06 Sep 00:28

What's Changed

Full Changelog: v2.0.10...v2.1.0

v2.0.10

Choose a tag to compare

@Galtozzy Galtozzy released this 17 Jan 17:09
4e1eea7

What's Changed

Full Changelog: v2.0.9...v2.0.10

v2.0.9

Choose a tag to compare

@Galtozzy Galtozzy released this 09 Jan 00:08
b469bfe

What's Changed

  • Fix default arguments are not respected when crafting cache key by @Galtozzy in #172
  • Better error message on the mismatch of key format params and function arguments @Galtozzy in #172

Full Changelog: v2.0.8...v2.0.9

v2.0.8

Choose a tag to compare

@Galtozzy Galtozzy released this 06 Jan 21:44
013134e

What's Changed

Full Changelog: v2.0.7...v2.0.8

v2.0.7

Choose a tag to compare

@Galtozzy Galtozzy released this 09 Dec 12:46

What's Changed

New Contributors

Full Changelog: v2.0.4...v2.0.7

v2.0.4

Choose a tag to compare

@Galtozzy Galtozzy released this 13 Nov 15:14

What's Changed

Full Changelog: v2.0.1...v2.0.4

v2.0.1

Choose a tag to compare

@Galtozzy Galtozzy released this 28 Oct 18:47
4c0b321

What's Changed

Full Changelog: v2.0.0...v2.0.1