Class StatefulRedisModulesConnectionImpl<K,V>

java.lang.Object
io.lettuce.core.RedisChannelHandler<K,V>
io.lettuce.core.StatefulRedisConnectionImpl<K,V>
com.redis.lettucemod.StatefulRedisModulesConnectionImpl<K,V>
Type Parameters:
K - Key type.
V - Value type.
All Implemented Interfaces:
StatefulRedisModulesConnection<K,V>, io.lettuce.core.api.AsyncCloseable, io.lettuce.core.api.StatefulConnection<K,V>, io.lettuce.core.api.StatefulRedisConnection<K,V>, io.lettuce.core.internal.AsyncCloseable, io.lettuce.core.protocol.ConnectionFacade, Closeable, AutoCloseable

public class StatefulRedisModulesConnectionImpl<K,V> extends io.lettuce.core.StatefulRedisConnectionImpl<K,V> implements StatefulRedisModulesConnection<K,V>
A thread-safe connection to a Redis server. Multiple threads may share one StatefulRedisModulesConnectionImpl A ConnectionWatchdog monitors each connection and reconnects automatically until RedisChannelHandler.close() is called. All pending commands will be (re)sent after successful reconnection.
Author:
Mark Paluch, Julien Ruaux
  • Field Summary

    Fields inherited from class io.lettuce.core.StatefulRedisConnectionImpl

    async, codec, multi, reactive, sync
  • Constructor Summary

    Constructors
    Constructor
    Description
    StatefulRedisModulesConnectionImpl(io.lettuce.core.RedisChannelWriter writer, io.lettuce.core.protocol.PushHandler pushHandler, io.lettuce.core.codec.RedisCodec<K,V> codec, Duration timeout)
    Initialize a new connection.
    StatefulRedisModulesConnectionImpl(io.lettuce.core.RedisChannelWriter writer, io.lettuce.core.protocol.PushHandler pushHandler, io.lettuce.core.codec.RedisCodec<K,V> codec, Duration timeout, Supplier<io.lettuce.core.json.JsonParser> parser)
    Initialize a new connection.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Create a new instance of RedisModulesAsyncCommandsImpl.
    protected io.lettuce.core.RedisReactiveCommandsImpl<K,V>
    Create a new instance of RedisModulesReactiveCommandsImpl.
    Create a new instance of RedisModulesCommands.
     
     

    Methods inherited from class io.lettuce.core.StatefulRedisConnectionImpl

    activated, addListener, deactivated, dispatch, dispatch, getCodec, getConnectionState, isMulti, postProcessCommand, postProcessCommands, preProcessCommand, preProcessCommands, removeListener, setAuthenticationHandler, setClientName

    Methods inherited from class io.lettuce.core.RedisChannelHandler

    addListener, addListener, close, closeAsync, flushCommands, getChannelWriter, getConnectionEvents, getOptions, getResources, getTimeout, isClosed, isOpen, registerCloseables, removeListener, reset, setAutoFlushCommands, setOptions, setTimeout, syncHandler

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.lettuce.core.api.StatefulConnection

    addListener, close, closeAsync, dispatch, dispatch, flushCommands, getOptions, getResources, getTimeout, isOpen, removeListener, reset, setAutoFlushCommands, setTimeout

    Methods inherited from interface io.lettuce.core.api.StatefulRedisConnection

    addListener, isMulti, removeListener
  • Constructor Details

    • StatefulRedisModulesConnectionImpl

      public StatefulRedisModulesConnectionImpl(io.lettuce.core.RedisChannelWriter writer, io.lettuce.core.protocol.PushHandler pushHandler, io.lettuce.core.codec.RedisCodec<K,V> codec, Duration timeout)
      Initialize a new connection.
      Parameters:
      writer - the channel writer.
      pushHandler - the handler for push notifications.
      codec - Codec used to encode/decode keys and values.
      timeout - Maximum time to wait for a response.
    • StatefulRedisModulesConnectionImpl

      public StatefulRedisModulesConnectionImpl(io.lettuce.core.RedisChannelWriter writer, io.lettuce.core.protocol.PushHandler pushHandler, io.lettuce.core.codec.RedisCodec<K,V> codec, Duration timeout, Supplier<io.lettuce.core.json.JsonParser> parser)
      Initialize a new connection.
      Parameters:
      writer - the channel writer.
      pushHandler - the handler for push notifications.
      codec - Codec used to encode/decode keys and values.
      timeout - Maximum time to wait for a response.
      parser - the parser to use for JSON commands.
  • Method Details

    • newRedisAsyncCommandsImpl

      protected RedisModulesAsyncCommandsImpl<K,V> newRedisAsyncCommandsImpl()
      Create a new instance of RedisModulesAsyncCommandsImpl. Can be overriden to extend.
      Overrides:
      newRedisAsyncCommandsImpl in class io.lettuce.core.StatefulRedisConnectionImpl<K,V>
    • newRedisReactiveCommandsImpl

      protected io.lettuce.core.RedisReactiveCommandsImpl<K,V> newRedisReactiveCommandsImpl()
      Create a new instance of RedisModulesReactiveCommandsImpl. Can be overriden to extend.
      Overrides:
      newRedisReactiveCommandsImpl in class io.lettuce.core.StatefulRedisConnectionImpl<K,V>
    • newRedisSyncCommandsImpl

      protected RedisModulesCommands<K,V> newRedisSyncCommandsImpl()
      Create a new instance of RedisModulesCommands. Can be overriden to extend.
      Overrides:
      newRedisSyncCommandsImpl in class io.lettuce.core.StatefulRedisConnectionImpl<K,V>
      Returns:
      a new instance
    • async

      public RedisModulesAsyncCommands<K,V> async()
      Specified by:
      async in interface io.lettuce.core.api.StatefulRedisConnection<K,V>
      Specified by:
      async in interface StatefulRedisModulesConnection<K,V>
      Overrides:
      async in class io.lettuce.core.StatefulRedisConnectionImpl<K,V>
    • sync

      public RedisModulesCommands<K,V> sync()
      Specified by:
      sync in interface io.lettuce.core.api.StatefulRedisConnection<K,V>
      Specified by:
      sync in interface StatefulRedisModulesConnection<K,V>
      Overrides:
      sync in class io.lettuce.core.StatefulRedisConnectionImpl<K,V>
    • reactive

      public RedisModulesReactiveCommands<K,V> reactive()
      Specified by:
      reactive in interface io.lettuce.core.api.StatefulRedisConnection<K,V>
      Specified by:
      reactive in interface StatefulRedisModulesConnection<K,V>
      Overrides:
      reactive in class io.lettuce.core.StatefulRedisConnectionImpl<K,V>