@@ -56,28 +56,27 @@ defmodule Task do
5656
5757 ## Supervised tasks
5858
59- It is also possible to spawn a task under a supervisor
60- with `start_link/1` and `start_link/3`:
61-
62- Task.start_link(fn -> IO.puts "ok" end)
63-
64- Such tasks can be mounted in your supervision tree as:
59+ It is also possible to spawn a task under a supervisor:
6560
6661 import Supervisor.Spec
6762
6863 children = [
64+ #
6965 worker(Task, [fn -> IO.puts "ok" end])
7066 ]
7167
68+ Internally the supervisor will invoke `Task.start_link/1`.
69+
7270 Since these tasks are supervised and not directly linked to
7371 the caller, they cannot be awaited on. Note `start_link/1`,
7472 unlike `async/1`, returns `{:ok, pid}` (which is
7573 the result expected by supervision trees).
7674
7775 By default, most supervision strategies will try to restart
78- a worker after it exits regardless of the reason. If you design the
79- task to terminate normally (as in the example with `IO.puts/2` above),
80- consider passing `restart: :transient` in the options to `Supervisor.Spec.worker/3`.
76+ a worker after it exits regardless of the reason. If you design
77+ the task to terminate normally (as in the example with `IO.puts/2`
78+ above), consider passing `restart: :transient` in the options
79+ to `Supervisor.Spec.worker/3`.
8180
8281 ## Dynamically supervised tasks
8382
0 commit comments