Configure Applications to Start Supervisors

Now that we’ve established some groundwork in vocabulary and you’ve seen how linked processes work, we should make a plan for what to do with Mastery. Before we can build out the different supervisors and start links, we need to look at our architecture and think logically about the lifecycles.

We have two kinds of GenServers. We will have exactly one QuizManager server and we’ll have one QuizSession server per user. The QuizManager will start when we bring the application up and will remain running throughout.

The QuizSession is a different beast entirely. It’s going to have a different lifecycle policy. The supervisor will need to start a QuizSession process when a user takes a quiz and shut it ...

Get Designing Elixir Systems With OTP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.