Class: Taskinator::ProcessWorker

Inherits:
Object
  • Object
show all
Defined in:
lib/taskinator/process_worker.rb

Instance Method Summary collapse

Constructor Details

#initialize(uuid) ⇒ ProcessWorker

Returns a new instance of ProcessWorker.



3
4
5
# File 'lib/taskinator/process_worker.rb', line 3

def initialize(uuid)
  @uuid = uuid
end

Instance Method Details

#performObject



7
8
9
10
11
12
13
14
15
# File 'lib/taskinator/process_worker.rb', line 7

def perform
  process = Taskinator::Process.fetch(@uuid)
  return if process.paused? || process.cancelled?
  begin
    process.start!
  rescue Exception => e
    process.fail!(e)
  end
end