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 Details

    • doInRedis

      @Nullable T doInRedis(RedisConnection connection) throws org.springframework.dao.DataAccessException
      Method called by RedisTemplate with an active RedisConnection.

      Callback code need not care about activating/opening or closing the RedisConnection, nor handling exceptions.

      Parameters:
      connection - active Redis connection.
      Returns:
      the result of the operation performed in the callback or null.
      Throws:
      org.springframework.dao.DataAccessException - if the operation performed by the callback fails to execute in the context of Redis using the given RedisConnection.