News for hackers. Stuff that matters.
Re:Show HN: Parex – Simple Elixir module for parallel execution by koudelka on Monday May 25, 2015 @11:40PM (#9602828)
The Task module is great for this kind of thing, too. http://elixir-lang.org/docs/v1.0/elixir/Task.html

  [
      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)

There are no comments on this comment yet.