Elixir v1.2.6 Task.Supervisor
A task supervisor.
This module defines a supervisor which can be used to dynamically
supervise tasks. Behind the scenes, this module is implemented as a
:simple_one_for_one
supervisor where the workers are temporary
(i.e. they are not restarted after they die).
See the Task
module for more information.
Name Registration
A Task.Supervisor
is bound to the same name registration rules as a
GenServer
. Read more about them in the GenServer
docs.
Summary
Functions
Starts a task that can be awaited on
Starts a task that can be awaited on
Starts a task that can be awaited on
Starts a task that can be awaited on
Returns all children pids
Starts a task as child of the given supervisor
Starts a task as child of the given supervisor
Starts a new supervisor
Terminates the child with the given pid
Functions
Starts a task that can be awaited on.
The supervisor
must be a reference as defined in Task.Supervisor
.
The task will still be linked to the caller, see Task.async/3
for
more information and async_nolink/2
for a non-linked variant.
Starts a task that can be awaited on.
The supervisor
must be a reference as defined in Task.Supervisor
.
The task will still be linked to the caller, see Task.async/3
for
more information and async_nolink/2
for a non-linked variant.
Starts a task that can be awaited on.
The supervisor
must be a reference as defined in Task.Supervisor
.
The task won’t be linked to the caller, see Task.async/3
for
more information.
async_nolink(Supervisor.supervisor, module, atom, [term]) :: Task.t
Starts a task that can be awaited on.
The supervisor
must be a reference as defined in Task.Supervisor
.
The task won’t be linked to the caller, see Task.async/3
for
more information.
Returns all children pids.
Starts a task as child of the given supervisor
.
Note that the spawned process is not linked to the caller, but only to the supervisor. This command is useful in case the task needs to perform side-effects (like I/O) and does not need to report back to the caller.
start_child(Supervisor.supervisor, module, atom, [term]) :: {:ok, pid}
Starts a task as child of the given supervisor
.
Similar to start_child/2
except the task is specified
by the given module
, fun
and args
.
Starts a new supervisor.
The supported options are:
:name
- used to register a supervisor name, the supported values are described under theName Registration
section in theGenServer
module docs;:restart
- the restart strategy, may be:temporary
(the default),:transient
or:permanent
. CheckSupervisor.Spec
for more info. Defaults to:temporary
as most tasks can’t be effectively restarted after a crash;:shutdown
-:brutal_kill
if the tasks must be killed directly on shutdown or an integer indicating the timeout value, defaults to 5000 milliseconds;:max_restarts
and:max_seconds
- as specified inSupervisor.Spec.supervise/2
;
Terminates the child with the given pid
.