Skip to content

Instantly share code, notes, and snippets.

@ybur-yug
Created July 19, 2015 19:07
Show Gist options
  • Save ybur-yug/1d3bc234c1697eb92594 to your computer and use it in GitHub Desktop.
Save ybur-yug/1d3bc234c1697eb92594 to your computer and use it in GitHub Desktop.
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