Class EventMachine::Hiredis::BaseClient
In: lib/em-hiredis/base_client.rb
Parent: Object

Emits the following events

  • :connected - on successful connection or reconnection
  • :reconnected - on successful reconnection
  • :disconnected - no longer connected, when previously in connected state
  • :reconnect_failed(failure_number) - a reconnect attempt failed
      This event is passed number of failures so far (1,2,3...)
    
  • :monitor

Methods

Included Modules

EventEmitter EM::Deferrable

Attributes

db  [R] 
host  [R] 
password  [R] 
port  [R] 

Public Class methods

Public Instance methods

Configure the redis connection to use

In usual operation, the uri should be passed to initialize. This method is useful for example when failing over to a slave connection at runtime

Starts an inactivity checker which will ping redis if nothing has been heard on the connection for `trigger_secs` seconds and forces a reconnect after a further `response_timeout` seconds if we still don‘t hear anything.

Indicates that commands have been sent to redis but a reply has not yet been received

This can be useful for example to avoid stopping the eventmachine reactor while there are outstanding commands

Disconnect then reconnect the redis connection.

Pass optional uri - e.g. to connect to a different redis server. Any pending redis commands will be failed, but during the reconnection new commands will be queued and sent after connected.

Note: This method doesn‘t disconnect if already connected. You probably want to use `reconnect!`

[Validate]