Skip to content

Instantly share code, notes, and snippets.

@PragTob
Last active April 24, 2019 09:18
Show Gist options
  • Select an option

  • Save PragTob/36aae079055dfcc2af523f8644f0b018 to your computer and use it in GitHub Desktop.

Select an option

Save PragTob/36aae079055dfcc2af523f8644f0b018 to your computer and use it in GitHub Desktop.
Simple elxir task
pick_up_task = Task.async(fn -> geocode(pick_up_address) end)
drop_off_task = Task.async(fn -> geocode(drop_off_address) end)
geocoded_addresses = Enum.map([pick_up_task, drop_off_task], fn task -> Task.await(task) end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment