Class: Proxy::Dynflow::TaskLauncher::Batch

Inherits:
Abstract
  • Object
show all
Defined in:
lib/smart_proxy_dynflow/task_launcher/batch.rb

Direct Known Subclasses

AbstractGroup

Instance Attribute Summary

Attributes inherited from Abstract

#callback, #options, #results, #world

Instance Method Summary collapse

Methods inherited from Abstract

#initialize, input_format, new_from_hash, #to_hash

Constructor Details

This class inherits a constructor from Proxy::Dynflow::TaskLauncher::Abstract

Instance Method Details

#child_launcher(parent) ⇒ Object



24
25
26
# File 'lib/smart_proxy_dynflow/task_launcher/batch.rb', line 24

def child_launcher(parent)
  Single.new(world, callback, :parent => parent)
end

#launch!(input) ⇒ Object



6
7
8
9
# File 'lib/smart_proxy_dynflow/task_launcher/batch.rb', line 6

def launch!(input)
  plan = trigger(nil, action_class, self, input)
  results[:parent] = format_result(plan)
end

#launch_children(parent, input_hash) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/smart_proxy_dynflow/task_launcher/batch.rb', line 11

def launch_children(parent, input_hash)
  input_hash.map do |task_id, input|
    launcher = child_launcher(parent)
    triggered = launcher.launch!(transform_input(input), id: task_id)
    results[task_id] = launcher.results
    triggered
  end
end

#prepare_batch(input_hash) ⇒ Object



20
21
22
# File 'lib/smart_proxy_dynflow/task_launcher/batch.rb', line 20

def prepare_batch(input_hash)
  input_hash
end