Skip to content

Commit 94326a3

Browse files
juhalehtonenjosevalim
authored andcommitted
Document need of Tasks to trap exits for Task.Supervisor :shutdown to have effect (#13004)
1 parent ef527ca commit 94326a3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/elixir/lib/task/supervisor.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ defmodule Task.Supervisor do
162162
163163
* `:shutdown` - `:brutal_kill` if the tasks must be killed directly on shutdown
164164
or an integer indicating the timeout value, defaults to 5000 milliseconds.
165+
The tasks must trap exits for the timeout to have an effect.
165166
166167
"""
167168
@spec async(Supervisor.supervisor(), (-> any), Keyword.t()) :: Task.t()
@@ -183,6 +184,7 @@ defmodule Task.Supervisor do
183184
184185
* `:shutdown` - `:brutal_kill` if the tasks must be killed directly on shutdown
185186
or an integer indicating the timeout value, defaults to 5000 milliseconds.
187+
The tasks must trap exits for the timeout to have an effect.
186188
187189
"""
188190
@spec async(Supervisor.supervisor(), module, atom, [term], Keyword.t()) :: Task.t()
@@ -208,6 +210,7 @@ defmodule Task.Supervisor do
208210
209211
* `:shutdown` - `:brutal_kill` if the tasks must be killed directly on shutdown
210212
or an integer indicating the timeout value, defaults to 5000 milliseconds.
213+
The tasks must trap exits for the timeout to have an effect.
211214
212215
## Compatibility with OTP behaviours
213216
@@ -337,6 +340,7 @@ defmodule Task.Supervisor do
337340
338341
* `:shutdown` - `:brutal_kill` if the tasks must be killed directly on shutdown
339342
or an integer indicating the timeout value. Defaults to `5000` milliseconds.
343+
The tasks must trap exits for the timeout to have an effect.
340344
341345
## Examples
342346
@@ -455,6 +459,7 @@ defmodule Task.Supervisor do
455459
456460
* `:shutdown` - `:brutal_kill` if the task must be killed directly on shutdown
457461
or an integer indicating the timeout value, defaults to 5000 milliseconds.
462+
The task must trap exits for the timeout to have an effect.
458463
459464
"""
460465
@spec start_child(Supervisor.supervisor(), (-> any), keyword) ::

0 commit comments

Comments
 (0)