Module: EventMachine::Hiredis
- Defined in:
- lib/em-hiredis.rb,
lib/em-hiredis/client.rb,
lib/em-hiredis/version.rb,
lib/em-hiredis/connection.rb,
lib/em-hiredis/base_client.rb,
lib/em-hiredis/event_emitter.rb,
lib/em-hiredis/pubsub_client.rb
Defined Under Namespace
Modules: EventEmitter Classes: BaseClient, Client, Connection, Error, PubsubClient, RedisError
Constant Summary collapse
- VERSION =
"0.3.1"
Class Attribute Summary collapse
-
.reconnect_timeout ⇒ Object
Returns the value of attribute reconnect_timeout.
Class Method Summary collapse
-
.connect(uri = nil) ⇒ Object
Connects to redis and returns a client instance.
- .logger ⇒ Object
- .logger=(logger) ⇒ Object
- .setup(uri = nil) ⇒ Object
Class Attribute Details
.reconnect_timeout ⇒ Object
Returns the value of attribute reconnect_timeout.
15 16 17 |
# File 'lib/em-hiredis.rb', line 15 def reconnect_timeout @reconnect_timeout end |
Class Method Details
.connect(uri = nil) ⇒ Object
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
37 38 39 40 41 |
# File 'lib/em-hiredis.rb', line 37 def self.connect(uri = nil) client = setup(uri) client.connect client end |
.logger ⇒ Object
47 48 49 50 51 52 53 54 |
# 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) ⇒ Object
43 44 45 |
# File 'lib/em-hiredis.rb', line 43 def self.logger=(logger) @@logger = logger end |