vdev Knot.SofoSupervisor
Defines a simple one-for-one generic supervisor.
Using SofoSupervisor
is usually done by importing its SofoSupervisor.Spec
submodule, and using it like so (eg. from your Application
definition file):
import SofoSupervisor.Spec
def start(_type, _args) do
children = [
...
sofo(MyApp.WorkersSup, MyApp.Worker),
...
]
Supervisor.start_link children, strategy: :one_for_one
end
This block would have started two simple one-for-one supervisor, each spawning different modules and registered under different names. Later on, you could spawn children on either one of these two supervisors, eg:
Supervisor.start_child MyApp.WorkersSup, [arg1, arg2]
Link to this section Summary
Link to this section Types
Link to this section Functions
Link to this function
init(arg)
init(atom) :: {:ok, {:supervisor.sup_flags, [:supervisor.child_spec]}}
Initializes a new simple one for one unbranded supervisor.