Class: Sensu::Redis

Inherits:
Object
  • Object
show all
Defined in:
lib/sensu/redis.rb

Class Method Summary collapse

Class Method Details

.connect(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/sensu/redis.rb', line 7

def self.connect(options={})
  options ||= Hash.new
  connection = EM::Protocols::Redis.connect(options)
  connection.info do |info|
    if info[:redis_version] < '1.3.14'
      klass = EM::Protocols::Redis::RedisError
      message = 'redis version must be >= 2.0 RC 1'
      connection.error(klass, message)
    end
  end
  connection
end