Last active
November 16, 2017 10:55
-
-
Save zacck-zz/3b7e97c4a6d504c6d37d760c214c9e1d 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
| 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