Method: Enumerable#parallel_max

Defined in:
lib/concurrent/parallel.rb

#parallel_max(n) ⇒ Object



48
49
50
51
52
# File 'lib/concurrent/parallel.rb', line 48

def parallel_max( n )
  parallel_subsets( n ).map do |slice|
    Thread.new { slice.max }
  end.map { |t| t.value }.max
end