ConnectionFactoryConfiguration
public struct ConnectionFactoryConfiguration
A configuration object for creating Redis connections with a connection pool.
Warning
This type has reference semantics due to theNIO.ClientBootstrap
reference.
-
The logger prototype that will be used by connections by default when generating logs.
Declaration
Swift
public internal(set) var connectionDefaultLogger: Logger { get }
-
The password used to authenticate connections.
Declaration
Swift
public let connectionPassword: String?
-
The initial database index that connections should use.
Declaration
Swift
public let connectionInitialDatabase: Int?
-
The pre-configured TCP client for connections to use.
Declaration
Swift
public let tcpClient: ClientBootstrap?
-
Creates a new connection factory configuration with the provided options.
Declaration
Swift
public init( connectionInitialDatabase: Int? = nil, connectionPassword: String? = nil, connectionDefaultLogger: Logger? = nil, tcpClient: ClientBootstrap? = nil )
Parameters
connectionInitialDatabase
The optional database index to initially connect to. The default is
nil
. Redis by default opens connections against index0
, so only set this value if the desired default is not0
.connectionPassword
The optional password to authenticate connections with. The default is
nil
.connectionDefaultLogger
The optional prototype logger to use as the default logger instance when generating logs from connections. If one is not provided, one will be generated. See
RedisLogging.baseConnectionLogger
.tcpClient
If you have chosen to configure a
NIO.ClientBootstrap
yourself, this will be used instead of the.makeRedisTCPClient
factory instance.