Class RedisChannelHandler<K,​V>

    • Constructor Detail

      • RedisChannelHandler

        public RedisChannelHandler​(RedisChannelWriter writer,
                                   Duration timeout)
        Parameters:
        writer - the channel writer
        timeout - timeout value
    • Method Detail

      • addListener

        public void addListener​(RedisConnectionStateListener listener)
        Add a listener for the RedisConnectionStateListener. The listener is notified every time a connect/disconnect/IO exception happens. The listener is called on the event loop thread so code within the listener methods must not block.
        Parameters:
        listener - must not be null.
        Since:
        6.2
      • removeListener

        public void removeListener​(RedisConnectionStateListener listener)
        Removes a listener.
        Parameters:
        listener - must not be null.
        Since:
        6.2
      • setTimeout

        public void setTimeout​(Duration timeout)
        Set the command timeout for this connection.
        Parameters:
        timeout - Command timeout.
        Since:
        5.0
      • closeAsync

        public CompletableFuture<Void> closeAsync()
        Close the connection (asynchronous).
        Since:
        5.1
      • registerCloseables

        public void registerCloseables​(Collection<Closeable> registry,
                                       Closeable... closeables)
        Register Closeable resources. Internal access only.
        Parameters:
        registry - registry of closeables
        closeables - closeables to register
      • addListener

        protected void addListener​(io.lettuce.core.CloseEvents.CloseListener listener)
      • isClosed

        public boolean isClosed()
        Returns:
        true if the connection is closed (final state in the connection lifecyle).
      • activated

        public void activated()
        Notification when the connection becomes active (connected).
        Specified by:
        activated in interface ConnectionFacade
      • deactivated

        public void deactivated()
        Notification when the connection becomes inactive (disconnected).
        Specified by:
        deactivated in interface ConnectionFacade
      • getChannelWriter

        public RedisChannelWriter getChannelWriter()
        Returns:
        the channel writer
      • isOpen

        public boolean isOpen()
        Returns:
        true if the connection is active and not closed.
      • setOptions

        public void setOptions​(ClientOptions clientOptions)
      • getTimeout

        public Duration getTimeout()
      • syncHandler

        protected <T> T syncHandler​(Object asyncApi,
                                    Class<?>... interfaces)
      • setAutoFlushCommands

        public void setAutoFlushCommands​(boolean autoFlush)
      • flushCommands

        public void flushCommands()