Class: CM::Batch::Celluloid

Inherits:
Object
  • Object
show all
Defined in:
lib/CM/batch/celluloid.rb

Instance Method Summary collapse

Instance Method Details

#execute_parallel(operation) ⇒ Object


Utilities



26
27
28
29
30
31
32
33
34
35
# File 'lib/CM/batch/celluloid.rb', line 26

def execute_parallel(operation)
  values = []
  resources.each do |resource|
    values << ::Celluloid::Future.new(resource) do
      resource.execute(operation)
    end
  end
  values = values.map { |future| future.value }
  !values.include?(false)
end

#normalize(reload) ⇒ Object


Plugin interface



9
10
11
12
# File 'lib/CM/batch/celluloid.rb', line 9

def normalize(reload)
  super
  yield if block_given?
end