Sha256: 4d715772f70f0f3a524a4e0bc80a70eb6b8fb08cdb845b722d24aabd74742161
Contents?: true
Size: 326 Bytes
Versions: 8
Compression:
Stored size: 326 Bytes
Contents
#!/usr/bin/env ruby $LOAD_PATH.push File.expand_path("../../lib", __FILE__) require "celluloid/autostart" module Enumerable # Simple parallel map using Celluloid::Futures def pmap(&block) futures = map { |elem| Celluloid::Future.new(elem, &block) } futures.map(&:value) end end p 100.times.pmap { |n| n * 2 }
Version data entries
8 entries across 8 versions & 1 rubygems