Class: Taskinator::Process::Sequential
- Inherits:
-
Taskinator::Process
- Object
- Taskinator::Process
- Taskinator::Process::Sequential
- Defined in:
- lib/taskinator/process.rb
Overview
Instance Attribute Summary
Attributes inherited from Taskinator::Process
#created_at, #definition, #options, #parent, #queue, #scope, #updated_at, #uuid
Instance Method Summary collapse
Methods inherited from Taskinator::Process
#<=>, #accept, #cancel!, #complete!, define_concurrent_process_for, define_sequential_process_for, #enqueue!, #fail!, #initialize, #no_tasks_defined?, #pause!, #resume!, #start!, #task_failed, #tasks, #tasks_completed?, #to_s
Methods included from Instrumentation
#cancelled_payload, #completed_payload, #enqueued_payload, #failed_payload, #instrument, #paused_payload, #processing_payload, #resumed_payload
Methods included from Taskinator::Persistence
add_process_to_list, deserialize, included, processes_list_key, serialize
Methods included from Workflow
#current_state, #current_state=, #transition
Constructor Details
This class inherits a constructor from Taskinator::Process
Instance Method Details
#enqueue ⇒ Object
184 185 186 187 188 189 190 |
# File 'lib/taskinator/process.rb', line 184 def enqueue if tasks.empty? complete! # weren't any tasks to start with else tasks.first.enqueue! end end |
#inspect ⇒ Object
210 211 212 |
# File 'lib/taskinator/process.rb', line 210 def inspect %(#<#{self.class.name}:0x#{self.__id__.to_s(16)} uuid="#{uuid}", state=:#{current_state}, tasks=[#{tasks.inspect}]>) end |
#start ⇒ Object
192 193 194 195 196 197 198 199 |
# File 'lib/taskinator/process.rb', line 192 def start task = tasks.first if task task.start! else complete! # weren't any tasks to start with end end |
#task_completed(task) ⇒ Object
201 202 203 204 205 206 207 208 |
# File 'lib/taskinator/process.rb', line 201 def task_completed(task) next_task = task.next if next_task next_task.enqueue! else complete! # aren't any more tasks end end |