...

/

Establishing Supervision Strategies

Establishing Supervision Strategies

Let's learn about some of the supervision strategies when we build a child spec.

As you’ll recall, when we build a child spec, we define the naming and lifecycle strategies our supervisors will apply to child processes. In general, this configuration code guides OTP in building the lifecycle.

Starting a worker

Let’s talk about what happens when we start a worker:

  • At startup, the worker will go down the list of child specs and start each of them using the child specs.

  • Some of those child specs will identify other supervisors or applications. Our application.ex child list has both.

  • Application.start then walks down a list of children and starts each one. Those children could be single processes, such as our QuizManager, or they could be applications in their own right.

Spinning up a child application means loading that application’s child list, and so on. That means our child list is a supervision tree.

Starting your application

Starting our ...