Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 18 Oct 18:36
· 4 commits to main since this release
dec2acc

🔄 Changed

  • RedisLock takes the client from a ConnectionManagerFactory like GenericCache does, with an optional alias: RedisLock(client_factory, key, timeout=10.0, blocking=False, *, alias=None). The lock borrows the client inside every call and keeps only its token between them, so a KafkaConsumerMaker can be wired with lock_kwargs={'client_factory': redis_client_factory, 'timeout': 300} and no client has to be opened up front. release / extend without an acquired lock raise redis-py's LockError, as before.
  • GenericCache.client_factory, RedisFeatureFlagStorage and RedisLock type the factory as ConnectionManagerFactory[Any, Redis, Any], so a project's ConnectionManagerFactory[Alias, Redis, ConnectionManager[Redis]] passes the type checker.

⚠️ Breaking changes

  • RedisLock(redis_client, key, ...) → RedisLock(client_factory, key, ...).
  • Requires ddutils 0.3.3.

Full Changelog: v0.1.1...v0.2.0