Skip to content

Instantly share code, notes, and snippets.

@nyo16
Created December 6, 2018 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nyo16/dbd84a2f9c3074cf31b64add2f781f7e to your computer and use it in GitHub Desktop.
Save nyo16/dbd84a2f9c3074cf31b64add2f781f7e to your computer and use it in GitHub Desktop.
def pmap(collection, func) do
collection
|> Enum.map(&(Task.async(fn -> func.(&1) end)))
|> Enum.map(&Task.await/1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment