Method: Redis#initialize
- Defined in:
- lib/redis.rb
#initialize(options = {}) ⇒ Redis
Create a new client instance
63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/redis.rb', line 63 def initialize( = {}) @monitor = Monitor.new @options = .dup @options[:reconnect_attempts] = 1 unless @options.key?(:reconnect_attempts) if ENV["REDIS_URL"] && SERVER_URL_OPTIONS.none? { |o| @options.key?(o) } @options[:url] = ENV["REDIS_URL"] end inherit_socket = @options.delete(:inherit_socket) @subscription_client = nil @client = initialize_client(@options) @client.inherit_socket! if inherit_socket end |