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 likeCLIENT 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 byRedisConnectionClient
- debugListener
listener for traffic going through this connection. Only for debugging and testing purposes
- Alphabetic
- By Inheritance
- ConnectionConfig
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
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 likeCLIENT 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 byRedisConnectionClient
- debugListener
listener for traffic going through this connection. Only for debugging and testing purposes
Value Members
- val actorName: commons.OptArg[String]
- val connectTimeout: commons.OptArg[FiniteDuration]
- val debugListener: DebugListener
- val initCommands: RedisBatch[Any]
- val localAddress: commons.OptArg[InetSocketAddress]
- val maxWriteSizeHint: commons.OptArg[Int]
- val reconnectionStrategy: RetryStrategy
- val socketOptions: List[SocketOption]