Elixir course

Elixir Level 7: GenServer

GenServer is level 7 of 16 of the LoWisa Elixir course. It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

Updated 2026-11-25

Stateful Processes

  • GenServer. A GenServer is the stateful-process behaviour: OTP’s battle-tested loop with your callbacks.
  • init and state. init builds the initial state: threaded through every callback thereafter.
  • Process dictionary honestly. State lives in the callback returns: not the process dictionary, which hides data from everyone.

Calls and Casts

  • handle_call. call is synchronous: the caller waits for a reply, with a timeout guarding it.
  • handle_cast. cast is fire-and-forget: no reply, no confirmation, chosen deliberately.
  • handle_info. handle_info receives everything else: monitors’ :DOWN, timers, raw messages.

Designing Reliable Servers

  • Small state, clear API. A good server owns one concern: its public API functions wrapping the message protocol.
  • Timeouts and hibernate. Servers declare call timeouts and hibernate when idle: long-lived processes tuned by contract.
  • Avoid blocking the loop. Slow work leaves the server: tasks do the waiting, the loop stays responsive.

Before and after this level

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.

Frequently asked questions

What does Elixir Level 7: GenServer cover?

Stateful Processes, Calls and Casts, Designing Reliable Servers: 3 lessons and 9 ideas.

What should I know before this level?

The level before it, Level 6: Tasks & Agents, which covers Tasks, Agents, Managing Concurrent Work.

Learn Elixir on your phone

The first level is free. LoWisa is on Google Play and the App Store.