module RedisAlerting

Constants

VERSION

Public Class Methods

publisher() click to toggle source
# File lib/redis_alerting.rb, line 25
def publisher
  if @config[:faye_url]
    return RedisAlerting::FayePublisher.new(@config[:faye_url])
  else
    return RedisAlerting::RedisPublisher.new(@redis)
  end
end
run(opts) click to toggle source
# File lib/redis_alerting.rb, line 12
def run(opts)
  @config    = RedisAlerting::Config.new(opts).to_hash
  log       = Logger.new STDOUT
  log.level = @config[:log_level]
  @redis     = ::Redis.new
  engine    = RedisAlerting::Engine.new(@config, @redis, log, publisher)

  loop do
    engine.run
    sleep @config[:interval]
  end
end