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

#option

Constructor Details

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

Returns a new instance of FakeHandler.



28
29
30
31
32
# File 'lib/daemonizer/handler.rb', line 28

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

Instance Method Details

#prepare(starter, &block) ⇒ Object



34
35
36
37
# File 'lib/daemonizer/handler.rb', line 34

def prepare(starter, &block)
  @prepare.call(block) if @prepare
  super
end

#startObject



39
40
41
# File 'lib/daemonizer/handler.rb', line 39

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