module Resque::Plugins::WorkerKiller

Constants

VERSION

Public Class Methods

extended(klass) click to toggle source
# File lib/resque/plugins/worker_killer.rb, line 28
def self.extended(klass)
  Resque.after_fork do |job|
    # this is ran in the forked child process
    # we do not let the monitor thread die since the process itself dies
    Thread.start { PrivateMethods.new(klass).monitor_oom }
  end
end

Public Instance Methods

worker_killer_logger() click to toggle source
# File lib/resque/plugins/worker_killer.rb, line 24
def worker_killer_logger
  @worker_killer_logger ||= ::Resque.logger
end
worker_killer_max_term() click to toggle source
# File lib/resque/plugins/worker_killer.rb, line 15
def worker_killer_max_term
  @worker_killer_max_term ||= (ENV['TERM_CHILD'] ? 10 : 0)
end
worker_killer_mem_limit() click to toggle source
# File lib/resque/plugins/worker_killer.rb, line 11
def worker_killer_mem_limit
  @worker_killer_mem_limit ||= 300 * 1024 # killo bytes
end
worker_killer_monitor_interval() click to toggle source
# File lib/resque/plugins/worker_killer.rb, line 7
def worker_killer_monitor_interval
  @worker_killer_monitor_interval ||= 1.0 # sec
end
worker_killer_verbose() click to toggle source
# File lib/resque/plugins/worker_killer.rb, line 19
def worker_killer_verbose
  @worker_killer_verbose = false if @worker_killer_verbose.nil?
  @worker_killer_verbose
end