Module: Enumerable
- Defined in:
- lib/tradier/core_ext/enumerable.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
5 6 7 8 |
# File 'lib/tradier/core_ext/enumerable.rb', line 5 def pmap(&block) futures = map { |elem| Celluloid::Future.new(elem, &block) } futures.map { |future| future.value } end |