class GoChanel::ErrNotifier

Public Class Methods

notify(e) click to toggle source
# File lib/go_chanel/err_notifier.rb, line 16
def self.notify(e)
  if @@std_out
    puts "Something wrong in Thread:"
    puts e
    puts e.backtrace
  end

  if @@notifier.present?
    @@mutex.synchronize do
      notifier.notify(e)
    end
  end
end
register(notifier, std_out = false) click to toggle source
# File lib/go_chanel/err_notifier.rb, line 6
def self.register(notifier, std_out = false)
  @@notifier = notifier
  @@std_out = std_out
  raise "notifier should have a func named as" unless notifier.respond_to?(:notify)
end
std_out=(open = true) click to toggle source
# File lib/go_chanel/err_notifier.rb, line 12
def self.std_out=(open = true)
  @@std_out = open
end