Created
July 19, 2015 19:07
-
-
Save ybur-yug/1d3bc234c1697eb92594 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Parallel | |
def pmap | |
collection | |
|> Enum.map(&(Task.async(fn -> func.(&1) end))) | |
|> Enum.map(&Task.await/1) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment