Class: Taskinator::ProcessWorker
- Inherits:
-
Object
- Object
- Taskinator::ProcessWorker
- Defined in:
- lib/taskinator/process_worker.rb
Instance Attribute Summary collapse
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(uuid) ⇒ ProcessWorker
constructor
A new instance of ProcessWorker.
- #perform ⇒ Object
Constructor Details
#initialize(uuid) ⇒ ProcessWorker
Returns a new instance of ProcessWorker.
5 6 7 |
# File 'lib/taskinator/process_worker.rb', line 5 def initialize(uuid) @uuid = uuid end |
Instance Attribute Details
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
3 4 5 |
# File 'lib/taskinator/process_worker.rb', line 3 def uuid @uuid end |
Instance Method Details
#perform ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/taskinator/process_worker.rb', line 9 def perform process = Taskinator::Process.fetch(@uuid) return if process.paused? || process.cancelled? begin process.start! rescue => e Taskinator.logger.error(e) process.fail!(e) raise e end end |