Entry point for API variants which return RedisBatches.
Entry point for API variants which expose all commands, including connection-level ones, i.e.
Entry point for API variants which expose all commands, including connection-level ones, i.e. the ones that access or modify Redis connection state.
Entry point for API variants which expose only keyed commands.
Entry point for API variants which expose node-level commands, i.e.
Entry point for API variants which expose node-level commands, i.e. the ones that don't access or modify Redis connection state.
Entry point for API variants which return RawCommands.
Object which contains implementations of various variants of Redis API that this driver provides. Each variant implements a set of methods corresponding directly to Redis commands, e.g. get method represents Redis
GET
command.API variants may differ from each other in several independent aspects:
The most important one is the result type returned by every method corresponding to a Redis command:
Future
s.Async
counterparts but execution is blocking and results are returned as unwrapped values.Async
andBlocking
API variants additionally come in three different "levels", each one exposing different subset of Redis commands. This reflects the fact that not every RedisExecutor (client implementation) supports every command (e.g. you can't execute unkeyed commands using RedisClusterClient).Every API variant may also use different types to represent Redis keys, hash keys and values. You can define your own API variants for arbitrary combination of key, hash key and value types as long as there is an instance of RedisDataCodec for every of these types.
For example, if you keep only numeric values on a Redis Cluster installation, you might define an API variant like this one:
API variants which use only
String
s (textual) or onlyByteString
s (binary) are already implemented by the driver, e.g. RedisApi.Keyed.Async.StringTyped, RedisApi.Batches.BinaryTyped.Note that RedisDataCodec is automatically provided for many simple types and also all types which have a
GenCodec
. This effectively gives you a complete serialization framework for keys, hash keys and values stored in Redis.Note that chosen key, hash key and value types can be adjusted "on the fly" with a convenient syntax. For example, if you need to use some case class as a value type in a single, specific place, you can do it without defining a completely separate API variant. For example: