class Zold::VerboseThread

Verbose thread

Public Class Methods

new(log = Log::NULL) click to toggle source
# File lib/zold/verbose_thread.rb, line 35
def initialize(log = Log::NULL)
  @log = log
end

Public Instance Methods

run(safe = false) { || ... } click to toggle source
# File lib/zold/verbose_thread.rb, line 39
    def run(safe = false)
      Thread.current.report_on_exception = false
      yield
    rescue Errno::ENOMEM => e
      @log.error(Backtrace.new(e).to_s)
      @log.error("We are too big in memory (#{Size.new(GetProcessMem.new.bytes.to_i)}), quitting; \
this is not a normal behavior, you may want to report a bug to our GitHub repository")
      abort
    rescue StandardError => e
      @log.error(Backtrace.new(e).to_s)
      raise e unless safe
    end