Search⌘ K
AI Features

Writing the Proctor Boundary Server

Explore how to build the Proctor boundary GenServer module in Elixir to schedule quizzes. Understand the server initialization, API design, and managing concurrent quizzes with handle_call. This lesson helps you implement core OTP concepts to manage quiz scheduling and process state efficiently.

We’ll create a new Proctor module in the Boundary namespace to implement a GenServer to schedule quizzes. It’s a single API, Proctor.schedule_quiz, but a complex one. Let’s walk through it step by step.

Establishing our GenServer

Create a new file /lib/mastery/boundary/proctor.ex so we can establish our GenServer:

C++
defmodule Mastery.Boundary.Proctor do
use GenServer
require Logger
alias Mastery.Boundary.{QuizManager, QuizSession}
end

We create the usual ceremonial module definition and a ...