...

/

Additional Options to Manipulate Supervisors

Additional Options to Manipulate Supervisors

Let's learn how we can start and stop our supervisor, and examine its policies.

There are a few more options to choose from when working with supervisors. Let’s take a look at them.

Starting and stopping

To explicitly start and stop a supervisor, we’d do this:

Executable

Press + to interact
{:ok, sup_pid} = Supervisor.start_link(
[%{id: Mastery.Boundary.QuizManager, \
start: { Mastery.Boundary.QuizManager, :start_link, [[ ]]}}], \
[strategy: :one_for_one, name: TestSupervisor])

Output

iex(1)> {:ok,
...