Class: Sisyphus::Worker

Inherits:
Object
  • Object
show all
Defined in:
lib/sisyphus/worker.rb

Constant Summary collapse

UNCAUGHT_ERROR =
'.'

Instance Method Summary collapse

Constructor Details

#initialize(job, output) ⇒ Worker



5
6
7
8
9
# File 'lib/sisyphus/worker.rb', line 5

def initialize(job, output)
  @job = job
  @output = output
  setup
end

Instance Method Details

#startObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/sisyphus/worker.rb', line 11

def start
  trap_signals

  loop do
    break if stopped?
    perform_job
  end

  exit! 0
end