Skip to content

Commit abbf173

Browse files
author
José Valim
committed
Do not talk about tuple child_spec before they are introduced
Signed-off-by: José Valim <[email protected]>
1 parent fc1c303 commit abbf173

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

lib/elixir/lib/supervisor.ex

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,10 @@ defmodule Supervisor do
101101
102102
## Start and shutdown
103103
104-
When the supervisor starts, it traverses all children and retrieves
105-
each child specification. It is at this moment `{Stack, [:hello]}`
106-
becomes a child specification by calling `Stack.child_spec([:hello])`.
107-
108-
Then the supervisor starts each child in the order they are defined.
109-
This is done by calling the function defined under the `:start` key
110-
in the child specification and typically defaults to `start_link/1`.
104+
When the supervisor starts, it traverses all child specifications and
105+
then starts each child in the order they are defined. This is done by
106+
calling the function defined under the `:start` key in the child
107+
specification and typically defaults to `start_link/1`.
111108
112109
The `start_link/1` (or a custom) is then called for each child process.
113110
The `start_link/1` function must return `{:ok, pid}` where `pid` is the
@@ -301,7 +298,9 @@ defmodule Supervisor do
301298
function.
302299
303300
You may also completely override the `child_spec/1` function in the Stack module
304-
and return your own child specification.
301+
and return your own child specification. Note there is no guarantee the `child_spec/1`
302+
function will be called by the Supervisor process, as other processes may invoke
303+
it to retrieve the child specification before reaching the supervisor.
305304
306305
## Exit reasons and restarts
307306

0 commit comments

Comments
 (0)