class Mysqlcollector::Deamon

Public Class Methods

new(method) click to toggle source
# File lib/mysqlcollector/daemon.rb, line 5
def initialize(method)
  @method = method
end

Public Instance Methods

run!() click to toggle source
# File lib/mysqlcollector/daemon.rb, line 9
def run!
  begin
    puts "Press Ctrl-C to stop MySQL Collector"

    loop do
      eval(@method)
      sleep(30)
    end
  rescue Interrupt
    puts "\n"

    # Appendix E. Exit Codes With Special Meanings
    # http://tldp.org/LDP/abs/html/exitcodes.html
    exit 130
  end
end