Skip to content

Instantly share code, notes, and snippets.

@zacck-zz
Last active November 16, 2017 10:55
Show Gist options
  • Select an option

  • Save zacck-zz/3b7e97c4a6d504c6d37d760c214c9e1d to your computer and use it in GitHub Desktop.

Select an option

Save zacck-zz/3b7e97c4a6d504c6d37d760c214c9e1d to your computer and use it in GitHub Desktop.
defmodule Archiver do
# function that handles list of items to archive
def archive([_h | _t] = items) do
results =
for item <- items do
archive_thing(item)
end
results
end
# function to handle each individual itemd
defp archive_thing(_t) do
:timer.sleep(:rand.uniform(10000))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment