Interface RedisCallback<T>
public interface RedisCallback<T>
Callback interface for Redis 'low level' code. To be used with
RedisTemplate
execution methods, often as
anonymous classes within a method implementation. Usually, used for chaining several operations together (
get/set/trim etc...
.- Author:
- Costin Leau, John Blum
-
Method Summary
Modifier and TypeMethodDescriptiondoInRedis
(RedisConnection connection) Method called byRedisTemplate
with an activeRedisConnection
.
-
Method Details
-
doInRedis
Method called byRedisTemplate
with an activeRedisConnection
.Callback code need not care about activating/opening or closing the
RedisConnection
, nor handlingexceptions
.- Parameters:
connection
- activeRedis connection
.- Returns:
- the
result
of the operation performed in the callback or null. - Throws:
DataAccessException
- if the operation performed by the callback fails to execute in the context of Redis using the givenRedisConnection
.
-