Module: Enumerable

Defined in:
lib/parallelize/enumerable_ext.rb

Defined Under Namespace

Modules: Parallelize

Instance Method Summary collapse

Instance Method Details

#peach(num_threads, collect_exceptions = false, &block) ⇒ Array

Divides the Enumerable objects into pieces and execute with multiple threads



85
86
87
# File 'lib/parallelize/enumerable_ext.rb', line 85

def peach num_threads, collect_exceptions = false, &block
  Parallelize.it self, num_threads, :each, collect_exceptions, &block
end

#pmap(num_threads, collect_exceptions = false, &block) ⇒ Array

Parallelized map.



93
94
95
# File 'lib/parallelize/enumerable_ext.rb', line 93

def pmap num_threads, collect_exceptions = false, &block
  Parallelize.it self, num_threads, :map, collect_exceptions, &block
end