Repository navigation
v0.2.0
🔄 Changed
RedisLocktakes the client from aConnectionManagerFactorylikeGenericCachedoes, with an optionalalias: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 aKafkaConsumerMakercan be wired withlock_kwargs={'client_factory': redis_client_factory, 'timeout': 300}and no client has to be opened up front.release/extendwithout an acquired lock raise redis-py'sLockError, as before.GenericCache.client_factory,RedisFeatureFlagStorageandRedisLocktype the factory asConnectionManagerFactory[Any, Redis, Any], so a project'sConnectionManagerFactory[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