April 2024
Beginner to intermediate
224 pages
5h 7m
English
Processes are the lowest-level concurrency primitives in Elixir, but it’s pretty rare to use them directly. Instead, you’ll use libraries that let you build processes without worrying about the details. GenServer stands for “generic server,” and it’s the most common process library.
GenServer is part of OTP, so it’s actually written in Erlang. Elixir provides the GenServer module to seamlessly bring this Erlang library into Elixir. It’s a very important library, so it has been integrated into the language very well.
GenServer solves a few problems that you have already seen:
A GenServer stores state and makes it available to all message handlers. This state can be modified in response to a message. ...
Read now
Unlock full access