EventMachine::Hiredis

Constants

VERSION

Attributes

reconnect_timeout[RW]

Public Class Methods

connect(uri = nil) click to toggle source

Connects to redis and returns a client instance

Will connect in preference order to the provided uri, the REDIS_URL environment variable, or localhost:6379

TCP connections are supported via redis://:password@host:port/db (only host and port components are required)

Unix socket uris are supported, e.g. unix:///tmp/redis.sock, however it's not possible to set the db or password - use initialize instead in this case

# File lib/em-hiredis.rb, line 37
def self.connect(uri = nil)
  client = setup(uri)
  client.connect
  client
end
logger() click to toggle source
# File lib/em-hiredis.rb, line 47
def self.logger
  @@logger ||= begin
    require 'logger'
    log = Logger.new(STDOUT)
    log.level = Logger::WARN
    log
  end
end
logger=(logger) click to toggle source
# File lib/em-hiredis.rb, line 43
def self.logger=(logger)
  @@logger = logger
end
setup(uri = nil) click to toggle source
# File lib/em-hiredis.rb, line 19
def self.setup(uri = nil)
  uri = uri || ENV["REDIS_URL"] || "redis://127.0.0.1:6379/0"
  client = Client.new
  client.configure(uri)
  client
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.