DynamicSupervisor.init
init, go back to DynamicSupervisor module for more information.
Specs
init([init_option()]) :: {:ok, sup_flags()}
Receives a set of options that initializes a dynamic supervisor.
This is typically invoked at the end of the init/1 callback of
module-based supervisors. See the "Module-based supervisors" section
in the module documentation for more information.
The options received by this function are also supported by start_link/1.
This function returns a tuple containing the supervisor options.
Examples
def init(_arg) do
DynamicSupervisor.init(max_children: 1000, strategy: :one_for_one)
endOptions
:strategy- the restart strategy option. The only supported value is:one_for_onewhich means that no other child is terminated if a child process terminates. You can learn more about strategies in theSupervisormodule docs.:max_restarts- the maximum number of restarts allowed in a time frame. Defaults to3.:max_seconds- the time frame in which:max_restartsapplies. Defaults to5.:max_children- the maximum amount of children to be running under this supervisor at the same time. When:max_childrenis exceeded,start_child/2returns{:error, :max_children}. Defaults to:infinity.:extra_arguments- arguments that are prepended to the arguments specified in the child spec given tostart_child/2. Defaults to an empty list.