The Task module is great for this kind of thing, too. <a href="http://elixir-lang.org/docs/v1.0/elixir/Task.html" rel="nofollow">http://elixir-lang.org/docs/v1.0/elixir/Task.html</a><p><pre><code> [
add: fn() -> 1+2 end,
hang1: fn() -> :timer.sleep(1000) end,
hang2: fn() -> :timer.sleep(5000) end
]
|> Enum.map(fn {k, t} ->
{k, Task.async(t)}
end)
|> Enum.map(fn {k, t} ->
{k, Task.await(t, :infinity)}
end)</code></pre>