Module: Enumerable
- Included in:
- Eye::Utils::AliveArray
- Defined in:
- lib/eye/utils/pmap.rb
Instance Method Summary collapse
-
#pmap(&block) ⇒ Object
Simple parallel map using Celluloid::Futures.
Instance Method Details
#pmap(&block) ⇒ Object
Simple parallel map using Celluloid::Futures
3 4 5 6 |
# File 'lib/eye/utils/pmap.rb', line 3 def pmap(&block) futures = map { |elem| Celluloid::Future.new(elem, &block) } futures.map { |future| future.value } end |