Class: Daemonizer::FakeHandler

Inherits:
Handler
  • Object
show all
Defined in:
lib/daemonizer/handler.rb

Instance Attribute Summary

Attributes inherited from Handler

#logger, #worker_id, #workers_count

Instance Method Summary collapse

Methods inherited from Handler

#after_fork, #option

Constructor Details

#initialize(prepare, start, handler_options = {}) ⇒ FakeHandler

Returns a new instance of FakeHandler.



31
32
33
34
35
# File 'lib/daemonizer/handler.rb', line 31

def initialize(prepare, start, handler_options = {})
  @prepare = prepare
  @start = start
  super(handler_options)
end

Instance Method Details

#prepare(block) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/daemonizer/handler.rb', line 37

def prepare(block)
  if @prepare
    @prepare.call(Daemonizer.logger, block)
  else
    super
  end
end

#startObject



45
46
47
# File 'lib/daemonizer/handler.rb', line 45

def start
  @start.call(Daemonizer.logger, @worker_id, @workers_count)
end