class Redis
def initialize(options = {})
-
(Redis)
- a new client instance
Options Hash:
(**options)
-
:role
(Symbol
) -- Role to fetch via Sentinel, either `:master` or `:slave` -
:sentinels
(Array
) -- List of sentinels to contact -
:inherit_socket
(Boolean
) -- Whether to use socket in forked process or not -
:reconnect_attempts
(Fixnum
) -- Number of attempts trying to connect -
:tcp_keepalive
(Hash, Fixnum
) -- Keepalive values, if Fixnum `intvl` and `probe` are calculated based on the value, if Hash `time`, `intvl` and `probes` can be specified as a Fixnum -
:id
(String
) -- ID for the client connection, assigns name to current connection by sending `CLIENT SETNAME` -
:driver
(Symbol
) -- Driver to use, currently supported: `:ruby`, `:hiredis`, `:synchrony` -
:db
(Fixnum
) -- Database to select after initial connect -
:password
(String
) -- Password to authenticate against server -
:connect_timeout
(Float
) -- timeout for initial connect in seconds -
:timeout
(Float
) -- timeout in seconds -
:path
(String
) -- path to server socket (overrides host and port) -
:port
(Fixnum
) -- server port -
:host
(String
) -- server hostname -
:url
(String
) -- a Redis URL, for a TCP connection: `redis://:[password]@[hostname]:[port]/[db]` (password, port and database are optional), for a unix socket connection: `unix://[path to Redis socket]`. This overrides all other options.
Parameters:
-
options
(Hash
) --
def initialize(options = {}) @options = options.dup @original_client = @client = Client.new(options) @queue = Hash.new { |h, k| h[k] = [] } super() # Monitor#initialize end