Interface RedisCacheWriter.CacheLockingConfiguration
- Enclosing interface:
- RedisCacheWriter
public static interface RedisCacheWriter.CacheLockingConfiguration
Interface that allows for configuring cache locking options.
- Since:
- 4.0
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionlockTimeout(RedisCacheWriter.TtlFunction ttlFunction) Configure aRedisCacheWriter.TtlFunctionto compute the lock timeout.Configure the sleep time between cache lock checks.
-
Method Details
-
sleepTime
Configure the sleep time between cache lock checks. Sleep time is applied to reattempt lock checks if a cache key is locked.- Parameters:
sleepTime- the sleep time, must not be null and must be greaterDuration.ZERO.
-
lockTimeout
Configure aRedisCacheWriter.TtlFunctionto compute the lock timeout.If no TTL function is specified, the RedisCacheWriter persistent lock keys. Persistent lock keys need to be removed in case of failures (e.g. Redis crashes before a lock key is removed). Expiring lock keys can become subject to GC timing if lock keys expire while a garbage collection halts the JVM.
- Parameters:
ttlFunction- the lock timeout function.
-