diff --git a/lib/koans/12_task.ex b/lib/koans/12_task.ex index 26970ee..4c6873d 100644 --- a/lib/koans/12_task.ex +++ b/lib/koans/12_task.ex @@ -7,12 +7,12 @@ defmodule Tasks do assert Task.await(task) + 1 == :__ end - koan "if you don't need a result, use start_link/1" do + koan "If you don't need a result, use start_link/1" do {result, _pid} = Task.start_link(fn -> 1+1 end) assert result == :__ end - koan "yield returns nothing if the task isn't done yet" do + koan "Yield returns nothing if the task isn't done yet" do handle = Task.async(fn -> :timer.sleep(100) 3 * 3 @@ -20,7 +20,7 @@ defmodule Tasks do assert Task.yield(handle, 10) == :__ end - koan "tasks can be aborted with shutdown" do + koan "Tasks can be aborted with shutdown" do handle = Task.async(fn -> :timer.sleep(100) 3 * 3 @@ -34,7 +34,7 @@ defmodule Tasks do assert Task.shutdown(handle) == {:ok, :__} end - koan "you can yield to multiple tasks at once and extract the results" do + koan "You can yield to multiple tasks at once and extract the results" do squares = [1,2,3,4] |> Enum.map(fn(number) -> Task.async(fn -> number * number end) end) |> Task.yield_many(100)