Skip to content

Commit 9b4a01f

Browse files
authored
Corrections & clarifications to Task.Supervisor docs (#11384)
1 parent 94993e0 commit 9b4a01f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lib/elixir/lib/task/supervisor.ex

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ defmodule Task.Supervisor do
7474
7575
This function could also receive `:restart` and `:shutdown` as options
7676
but those two options have been deprecated and it is now preferred to
77-
give them directly to `start_child` and `async`.
77+
give them directly to `start_child`.
7878
"""
7979
@spec start_link([option]) :: Supervisor.on_start()
8080
def start_link(options \\ []) do
@@ -105,7 +105,7 @@ defmodule Task.Supervisor do
105105
106106
The `supervisor` must be a reference as defined in `Supervisor`.
107107
The task will still be linked to the caller, see `Task.async/3` for
108-
more information and `async_nolink/2` for a non-linked variant.
108+
more information and `async_nolink/3` for a non-linked variant.
109109
110110
Raises an error if `supervisor` has reached the maximum number of
111111
children.
@@ -126,7 +126,7 @@ defmodule Task.Supervisor do
126126
127127
The `supervisor` must be a reference as defined in `Supervisor`.
128128
The task will still be linked to the caller, see `Task.async/3` for
129-
more information and `async_nolink/2` for a non-linked variant.
129+
more information and `async_nolink/3` for a non-linked variant.
130130
131131
Raises an error if `supervisor` has reached the maximum number of
132132
children.
@@ -235,7 +235,7 @@ defmodule Task.Supervisor do
235235
children.
236236
237237
Note this function requires the task supervisor to have `:temporary`
238-
as the `:restart` option (the default), as `async_nolink/4` keeps a
238+
as the `:restart` option (the default), as `async_nolink/5` keeps a
239239
direct reference to the task which is lost if the task is restarted.
240240
"""
241241
@spec async_nolink(Supervisor.supervisor(), module, atom, [term], Keyword.t()) :: Task.t()
@@ -249,7 +249,7 @@ defmodule Task.Supervisor do
249249
250250
Each element will be prepended to the given `args` and processed by its
251251
own task. The tasks will be spawned under the given `supervisor` and
252-
linked to the caller process, similarly to `async/4`.
252+
linked to the caller process, similarly to `async/5`.
253253
254254
When streamed, each task will emit `{:ok, value}` upon successful
255255
completion or `{:exit, reason}` if the caller is trapping exits.
@@ -308,7 +308,7 @@ defmodule Task.Supervisor do
308308
309309
Each element in `enumerable` is passed as argument to the given function `fun`
310310
and processed by its own task. The tasks will be spawned under the given
311-
`supervisor` and linked to the caller process, similarly to `async/2`.
311+
`supervisor` and linked to the caller process, similarly to `async/3`.
312312
313313
See `async_stream/6` for discussion, options, and examples.
314314
"""
@@ -325,7 +325,7 @@ defmodule Task.Supervisor do
325325
326326
Each element in `enumerable` will be prepended to the given `args` and processed
327327
by its own task. The tasks will be spawned under the given `supervisor` and
328-
will not be linked to the caller process, similarly to `async_nolink/4`.
328+
will not be linked to the caller process, similarly to `async_nolink/5`.
329329
330330
See `async_stream/6` for discussion, options, and examples.
331331
"""
@@ -350,7 +350,7 @@ defmodule Task.Supervisor do
350350
Each element in `enumerable` is passed as argument to the given function `fun`
351351
and processed by its own task. The tasks will be spawned under the given
352352
`supervisor` and will not be linked to the caller process, similarly
353-
to `async_nolink/2`.
353+
to `async_nolink/3`.
354354
355355
See `async_stream/6` for discussion and examples.
356356
"""
@@ -387,17 +387,17 @@ defmodule Task.Supervisor do
387387
Note that the spawned process is not linked to the caller, but
388388
only to the supervisor. This command is useful in case the
389389
task needs to perform side-effects (like I/O) and you have no
390-
interest on its results nor if it completes successfully.
390+
interest in its results nor if it completes successfully.
391391
392392
## Options
393393
394394
* `:restart` - the restart strategy, may be `:temporary` (the default),
395395
`:transient` or `:permanent`. `:temporary` means the task is never
396396
restarted, `:transient` means it is restarted if the exit is not
397397
`:normal`, `:shutdown` or `{:shutdown, reason}`. A `:permanent` restart
398-
strategy means it is always restarted. It defaults to `:temporary`.
398+
strategy means it is always restarted.
399399
400-
* `:shutdown` - `:brutal_kill` if the tasks must be killed directly on shutdown
400+
* `:shutdown` - `:brutal_kill` if the task must be killed directly on shutdown
401401
or an integer indicating the timeout value, defaults to 5000 milliseconds.
402402
403403
"""
@@ -413,7 +413,7 @@ defmodule Task.Supervisor do
413413
@doc """
414414
Starts a task as a child of the given `supervisor`.
415415
416-
Similar to `start_child/2` except the task is specified
416+
Similar to `start_child/3` except the task is specified
417417
by the given `module`, `fun` and `args`.
418418
"""
419419
@spec start_child(Supervisor.supervisor(), module, atom, [term], keyword) ::

0 commit comments

Comments
 (0)