Completing the Implementation of the Proctor Boundary Server
Explore how to complete the implementation of the Proctor boundary server by integrating it with the Mastery application. Understand managing active quiz sessions using Elixir supervisors and registries, filtering process entries, and safely terminating sessions as scheduled.
Our Proctor is a masterpiece, but we still have to wire it into the rest of Mastery. The boundary has two different points of integration. We will need to:
-
Revise the
QuizManagerto return the active sessions for a quiz. -
Adapt
QuizSessionto end the sessions for a given title as our scheduler terminates them.
Those integrations should go quickly.
Returning active sessions
A big part of the battle of building concurrent systems is finding the processes to manage them. That’s the domain of the registry. To get the existing sessions with a given title, we will lean on our supervisor and the corresponding registry for our dynamic supervisor. We’ll open up /lib/mastery/boundary/quiz_session.ex and add this function to return active sessions:
-
We start with the name of our supervisor,
Mastery.Supervisor.QuizSession...