RedisStore

constructor(connection: StatefulRedisConnection<ByteArray, ByteArray>, indexName: String = "kmemo-idx", keyPrefix: String = "kmemo:", ttl: Duration? = null, clock: Clock = Clock.systemUTC(), closeConnection: Boolean = false)

Parameters

connection

an open Lettuce connection with a byte-array codec, speaking RESP2 (this store parses FT.SEARCH replies as classic RESP2 arrays; RESP3 returns a map it does not decode). The RedisClient secondary constructor handles both for you — prefer it.

indexName

RediSearch index name; give each logical cache its own.

keyPrefix

prefix for this cache's hash keys; the index only sees keys under it.

ttl

how long an entry stays valid, or null to keep it until removed.

clock

time source; substitute a fixed clock in tests instead of sleeping.

closeConnection

whether close should also close connection.


constructor(client: RedisClient, indexName: String = "kmemo-idx", keyPrefix: String = "kmemo:", ttl: Duration? = null, clock: Clock = Clock.systemUTC())

Connects to client with a byte-array codec, pinning RESP2 (RediSearch replies are parsed as RESP2 arrays), and owns the connection (closed by close).