Class: DepthFirst::ParallelOrganizer

Inherits:
SequentialOrganizer show all
Defined in:
lib/depth_first/parallel_organizer.rb

Overview

Base parallel organizer class

Constant Summary collapse

DEPENDENCIES =
[].freeze

Constants inherited from SequentialOrganizer

SequentialOrganizer::TASKS

Instance Attribute Summary

Attributes inherited from Task

#options

Instance Method Summary collapse

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(options)
  super(options)
  load_dependencies
end

Instance Method Details

#performObject



11
12
13
14
# File 'lib/depth_first/parallel_organizer.rb', line 11

def perform
  tasks.map { |task| execute_promise(task) }
       .reduce(options) { |a, e| resolve_promise(a, e) }
end