Elixir Fundamentals interview question · Most asked

What is a GenServer?

Create a free account to save this page, take notes and track your progress. Sign in

Summary

An OTP behaviour for a process that holds state and handles synchronous calls (handle_call), asynchronous casts (handle_cast) and other messages (handle_info). A client API wraps the message passing.

Longer Answer

Run GenServers under supervisors; avoid slow work in callbacks because messages are processed one at a time.

Key Points

  • Stateful server process.
  • call (sync) vs cast (async).
  • Supervised; one message at a time.

Deep dive: Elixir Fundamentals: GenServer and Supervisors

More most-asked Elixir Fundamentals questions

← All Elixir Fundamentals questions

Was this page helpful?