@@ -147,10 +147,10 @@ defmodule Supervisor do
147
147
The child specification describes how the supervisor starts, shuts down,
148
148
and restarts child processes.
149
149
150
- The child specification contains 5 keys. The first two are required,
150
+ The child specification contains 6 keys. The first two are required,
151
151
and the remaining ones are optional:
152
152
153
- * `:id` - a value used to identify the child specification
153
+ * `:id` - any term used to identify the child specification
154
154
internally by the supervisor; defaults to the given module.
155
155
In the case of conflicting `:id` values, the supervisor will refuse
156
156
to initialize and require explicit IDs. This key is required.
@@ -338,7 +338,7 @@ defmodule Supervisor do
338
338
restarts in transient mode, and linked processes exit with the same
339
339
reason unless they're trapping exits
340
340
341
- Notice that supervisor that reached maximum restart intensity will exit with
341
+ Notice that the supervisor that reaches maximum restart intensity will exit with
342
342
`:shutdown` reason. In this case the supervisor will only be restarted if its
343
343
child specification was defined with the `:restart` option set to `:permanent`
344
344
(the default).
@@ -390,7 +390,7 @@ defmodule Supervisor do
390
390
can run as a child of another supervision in the tree. The generated
391
391
`child_spec/1` can be customized with the following options:
392
392
393
- * `:id` - the child specification id , defaults to the current module
393
+ * `:id` - the child specification identifier , defaults to the current module
394
394
* `:start` - how to start the child process (defaults to calling `__MODULE__.start_link/1`)
395
395
* `:restart` - when the supervisor should be restarted, defaults to `:permanent`
396
396
@@ -440,10 +440,9 @@ defmodule Supervisor do
440
440
processes are terminated and then all child processes (including
441
441
the terminated one) are restarted.
442
442
443
- * `:rest_for_one` - if a child process terminates, the "rest" of
444
- the child processes, i.e., the child processes after the terminated
445
- one in start order, are terminated. Then the terminated child
446
- process and the rest of the child processes are restarted.
443
+ * `:rest_for_one` - if a child process terminates, the terminated child
444
+ process and the rest of the children started after it, are terminated and
445
+ restarted.
447
446
448
447
In the above, process termination refers to unsuccessful termination, which
449
448
is determined by the `:restart` option.
@@ -452,7 +451,7 @@ defmodule Supervisor do
452
451
has been replaced by the `DynamicSupervisor`. The `:simple_one_for_one`
453
452
supervisor was similar to `:one_for_one` but suits better when dynamically
454
453
attaching children. Many functions in this module behaved slightly
455
- differently when this strategy is used. See the `DynamicSupervisor` module
454
+ differently when this strategy was used. See the `DynamicSupervisor` module
456
455
for more information and migration strategies.
457
456
458
457
## Name registration
@@ -534,7 +533,7 @@ defmodule Supervisor do
534
533
# Note we have inlined all types for readability
535
534
@ typedoc "The supervisor specification"
536
535
@ type child_spec :: % {
537
- required ( :id ) => term ( ) ,
536
+ required ( :id ) => atom ( ) | term ( ) ,
538
537
required ( :start ) => { module ( ) , atom ( ) , [ term ( ) ] } ,
539
538
optional ( :restart ) => :permanent | :transient | :temporary ,
540
539
optional ( :shutdown ) => timeout ( ) | :brutal_kill ,
0 commit comments