Module: ChoresKit::EmbeddedTask

Defined in:
lib/chores_kit/chore/embedded_task.rb

Instance Method Summary collapse

Instance Method Details

#nameObject



3
4
5
# File 'lib/chores_kit/chore/embedded_task.rb', line 3

def name
  task.name
end

#runObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/chores_kit/chore/embedded_task.rb', line 7

def run
  puts "Running task #{name}"
  task.run

  return unless successors

  Thread.abort_on_exception = true
  threads = []

  threads << Thread.new do
    successors.map(&:run)
  end

  threads.map(&:join)
end