Packages

c

com.avsystem.commons.redis.config

ConnectionConfig

case class ConnectionConfig(initCommands: RedisBatch[Any] = RedisBatch.unit, actorName: commons.OptArg[String] = OptArg.Empty, localAddress: commons.OptArg[InetSocketAddress] = OptArg.Empty, socketOptions: List[SocketOption] = Nil, connectTimeout: commons.OptArg[FiniteDuration] = OptArg.Empty, maxWriteSizeHint: commons.OptArg[Int] = 50000, reconnectionStrategy: RetryStrategy = ..., debugListener: DebugListener = DevNullListener) extends Product with Serializable

Configuration options for a single Redis connection.

initCommands usage example:

implicit val actorSystem = ActorSystem()
import RedisApi.Batches.StringTyped._
val nodeClient = new RedisNodeClient(
  config = NodeConfig(
    poolSize = 8,
    connectionConfigs = connectionId => ConnectionConfig(
      initCommands = auth("mypassword") *> clientSetname(s"conn_$$connectionId") *> select(1)
    )
  )
)
initCommands

commands always sent upon establishing a Redis connection (and every time it's reconnected). The most common reason to configure initCommands is to specify authentication password used by every connection (AUTH command), but it's also useful for commands like CLIENT SETNAME, SELECT, etc. Note that these are all commands that can't be executed directly by RedisNodeClient or RedisClusterClient.

actorName

name of the actor representing the connection

localAddress

local bind address for the connection

socketOptions

socket options for the connection

connectTimeout

timeout for establishing connection

maxWriteSizeHint

hint for maximum number of bytes sent in a single network write message (the actual number of bytes sent may be slightly larger)

reconnectionStrategy

a RetryStrategy used to determine what delay should be used when reconnecting a failed connection. NOTE: reconnectionStrategy is ignored by RedisConnectionClient

debugListener

listener for traffic going through this connection. Only for debugging and testing purposes

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConnectionConfig
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ConnectionConfig(initCommands: RedisBatch[Any] = RedisBatch.unit, actorName: commons.OptArg[String] = OptArg.Empty, localAddress: commons.OptArg[InetSocketAddress] = OptArg.Empty, socketOptions: List[SocketOption] = Nil, connectTimeout: commons.OptArg[FiniteDuration] = OptArg.Empty, maxWriteSizeHint: commons.OptArg[Int] = 50000, reconnectionStrategy: RetryStrategy = ..., debugListener: DebugListener = DevNullListener)

    initCommands

    commands always sent upon establishing a Redis connection (and every time it's reconnected). The most common reason to configure initCommands is to specify authentication password used by every connection (AUTH command), but it's also useful for commands like CLIENT SETNAME, SELECT, etc. Note that these are all commands that can't be executed directly by RedisNodeClient or RedisClusterClient.

    actorName

    name of the actor representing the connection

    localAddress

    local bind address for the connection

    socketOptions

    socket options for the connection

    connectTimeout

    timeout for establishing connection

    maxWriteSizeHint

    hint for maximum number of bytes sent in a single network write message (the actual number of bytes sent may be slightly larger)

    reconnectionStrategy

    a RetryStrategy used to determine what delay should be used when reconnecting a failed connection. NOTE: reconnectionStrategy is ignored by RedisConnectionClient

    debugListener

    listener for traffic going through this connection. Only for debugging and testing purposes

Value Members

  1. val actorName: commons.OptArg[String]
  2. val connectTimeout: commons.OptArg[FiniteDuration]
  3. val debugListener: DebugListener
  4. val initCommands: RedisBatch[Any]
  5. val localAddress: commons.OptArg[InetSocketAddress]
  6. val maxWriteSizeHint: commons.OptArg[Int]
  7. val reconnectionStrategy: RetryStrategy
  8. val socketOptions: List[SocketOption]