RedisCacheClient

Redis-backed CacheClient via the Lettuce coroutines API.

The Redis connection is established lazily — the first command to execute triggers RedisClient.connect. This means you can construct an instance up front without requiring Redis to be running.

Supports TTL via expire and per-field TTL via hexpire (Redis 7.4+). When hexpire is not supported a one-time warning is logged and the call is silently ignored.

Parameters

uri

Redis connection URI (e.g. redis://localhost:6379).

Constructors

Link copied to clipboard
constructor(uri: String)

Functions

Link copied to clipboard
open suspend override fun del(vararg keys: String): Long
Link copied to clipboard
open suspend override fun exists(key: String): Boolean
Link copied to clipboard
open suspend override fun expire(key: String, ttl: Duration)
Link copied to clipboard
open suspend override fun hdel(key: String, vararg fields: String): Long
Link copied to clipboard
open suspend override fun hexpire(key: String, ttl: Duration, vararg fields: String)
Link copied to clipboard
open suspend override fun hget(key: String, field: String): String?
Link copied to clipboard
open suspend override fun hgetAll(key: String): Map<String, String>
Link copied to clipboard
open suspend override fun hset(key: String, entries: Map<String, String>): Long
open suspend override fun hset(key: String, field: String, value: String): Boolean