Class: DepthFirst::ParallelOrganizer
- Inherits:
-
SequentialOrganizer
- Object
- Task
- SequentialOrganizer
- DepthFirst::ParallelOrganizer
- Defined in:
- lib/depth_first/parallel_organizer.rb
Overview
Base parallel organizer class
Constant Summary collapse
- DEPENDENCIES =
[].freeze
Constants inherited from SequentialOrganizer
Instance Attribute Summary
Attributes inherited from Task
Instance Method Summary collapse
-
#initialize(options) ⇒ ParallelOrganizer
constructor
A new instance of ParallelOrganizer.
- #perform ⇒ Object
Constructor Details
#initialize(options) ⇒ ParallelOrganizer
Returns a new instance of ParallelOrganizer.
6 7 8 9 |
# File 'lib/depth_first/parallel_organizer.rb', line 6 def initialize() super() load_dependencies end |
Instance Method Details
#perform ⇒ Object
11 12 13 14 |
# File 'lib/depth_first/parallel_organizer.rb', line 11 def perform tasks.map { |task| execute_promise(task) } .reduce() { |a, e| resolve_promise(a, e) } end |