Interface LettuceConnection.PipeliningFlushPolicy

Enclosing class:
LettuceConnection

public static interface LettuceConnection.PipeliningFlushPolicy
Strategy interface to control pipelining flush behavior. Lettuce writes (flushes) each command individually to the Redis connection. Flushing behavior can be customized to optimize for performance. Flushing can be either stateless or stateful. An example for stateful flushing is size-based (buffer) flushing to flush after a configured number of commands.
Since:
2.3
Author:
Mark Paluch
See Also:
  • StatefulConnection.setAutoFlushCommands(boolean)
  • StatefulConnection.flushCommands()
  • Method Details

    • flushEachCommand

      static LettuceConnection.PipeliningFlushPolicy flushEachCommand()
      Return a policy to flush after each command (default behavior).
      Returns:
      a policy to flush after each command.
    • flushOnClose

      Return a policy to flush only if LettuceConnection.closePipeline() is called.
      Returns:
      a policy to flush after each command.
    • buffered

      static LettuceConnection.PipeliningFlushPolicy buffered(int bufferSize)
      Return a policy to buffer commands and to flush once reaching the configured bufferSize. The buffer is recurring so a buffer size of e.g. 2 will flush after 2, 4, 6, … commands.
      Parameters:
      bufferSize - the number of commands to buffer before flushing. Must be greater than zero.
      Returns:
      a policy to flush buffered commands to the Redis connection once the configured number of commands was issued.
    • newPipeline