EsRedisConnectionOptions
Description
A configuration object used to specify the parameters for connecting to a Redis server. It allows for setting the connection type (TCP or Unix socket), endpoint details (host/port or path), and timeouts for both establishing the connection and executing commands.
Instances are typically created using the class-side convenience methods #tcp or #unixSocket.
Instance Variables
-
type - <Integer> The connection type (REDIS_CONN_TCP or REDIS_CONN_UNIX).
-
host - <String> The hostname for a TCP connection.
-
port - <Integer> The port number for a TCP connection.
-
path - <String> The file path for a Unix socket connection.
-
connectTimeout - <Duration> The timeout for establishing a connection.
-
commandTimeout - <Duration> The timeout for individual commands.
-
connectTimeoutStruct - <OSUInt8> The low-level C structure for the connect timeout.
-
commandTimeoutStruct - <OSUInt8> The low-level C structure for the command timeout.
Examples
| tcpOptions unixOptions |
tcpOptions := EsRedisConnectionOptions tcp
host: '127.0.0.1';
port: 6379;
commandTimeout: 5 seconds.
unixOptions := EsRedisConnectionOptions unixSocket
path: '/tmp/redis.sock'.
Class Methods
tcp
Answer a new options object configured for a TCP connection.
Answers:
<EsRedisConnectionOptions>
unixSocket
Answer a new options object configured for a Unix domain socket connection.
Answers:
<EsRedisConnectionOptions>
Instance Methods
commandTimeout
Get the timeout for individual commands.
Answers:
<Duration> The timeout value or nil if not set.
commandTimeout:
Set the timeout for individual commands.
Arguments:
aDuration - <Duration> The timeout value.
connectTimeout
Set the timeout for establishing the connection.
Answers:
<Duration> The timeout value or nil
connectTimeout:
Set the timeout for establishing the connection.
Arguments:
aDuration - <Duration> The timeout value.
establishConnectionFor:
Establish a standard TCP connection and answer the connected socket.
This is the base implementation for non-SSL connections.
Arguments:
aClient - <EsRedisClient> The client requesting the connection.
Answers:
<SciSocket> The connected socket.
Raises:
<EsRedisConnectionException> If the connection fails.
host
Get the hostname or IP address for a TCP connection.
Answers:
<String>
host:
Set the hostname or IP address for a TCP connection.
Arguments:
aString - <String>
path:
Get the path for a Unix domain socket connection.
Answers:
<String>
port
Get the port number for a TCP connection.
Answers:
anInteger
port:
Set the port number for a TCP connection.
Arguments:
anInteger - <Integer>
Last modified date: 01/22/2026