Module: WorkerKiller

Defined in:
lib/worker_killer.rb,
lib/worker_killer/killer.rb,
lib/worker_killer/version.rb,
lib/worker_killer/middleware.rb,
lib/worker_killer/killer/puma.rb,
lib/worker_killer/puma_plugin.rb,
lib/worker_killer/configuration.rb,
lib/worker_killer/count_limiter.rb,
lib/worker_killer/killer/signal.rb,
lib/worker_killer/memory_limiter.rb,
lib/worker_killer/killer/passenger.rb,
lib/worker_killer/delayed_job_plugin.rb,
lib/worker_killer/killer/delayed_job.rb

Defined Under Namespace

Modules: Killer Classes: Configuration, CountLimiter, DelayedJobPlugin, MemoryLimiter, Middleware, PumaPlugin

Constant Summary collapse

VERSION =
'1.1.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



12
13
14
# File 'lib/worker_killer.rb', line 12

def configuration
  @configuration
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



16
17
18
19
# File 'lib/worker_killer.rb', line 16

def self.configure
  self.configuration ||= WorkerKiller::Configuration.new
  yield(configuration) if block_given?
end

.randomize(integer) ⇒ Object



23
24
25
# File 'lib/worker_killer.rb', line 23

def self.randomize(integer)
  RUBY_VERSION > '1.9' ? Random.rand(integer.abs) : rand(integer)
end