#Genserver
8 notas · última:
Unit Tests in Elixir - Part 2
Explains how to unit test Elixir functions that talk to other processes by injecting dependencies, and by treating GenServer casts as commands and calls as queries.
Building Distributed Systems in Elixir: Part 1 - Building a Stateful Process in Elixir Without GenServer
The article shows how a counter can be built as a BEAM process with private state, message passing, and a recursive receive loop, then contrasts that core model with what GenServer adds.
A Brief Guide to OTP in Elixir
The article introduces OTP as Elixir’s process-based toolkit, then shows basic processes, receive loops, GenServer callbacks, and a Supervisor for restarting a treasury process.
OTP as the Core of Your Application Part 1
The post explains the Actor Model on the BEAM, then builds a Phoenix bookstore that reads from GenServers in later parts. Here it sets up the app, scrapes Manning data, and seeds Postgres.
Supervising multiple GenServer processes
The post refactors a single board monitor into one GenServer per board, supervised by a module-based Supervisor, so a failure in one board does not wipe the state of the others.
Handling TCP connections in Elixir
The article shows how to wrap a TCP client in a GenServer, avoid blocking with queued replies, use active sockets carefully, and add reconnect backoff with Connection.
Elixir Flow-Based Programming
The author explores implementing flow-based programming in Elixir by using GenServer and Erlang digraphs, then adds initial values, component ports, and multiple processes per component to exploit concurrency.
An intro to OTP in Elixir
The post explains OTP as Erlang’s development environment for concurrent programming, then builds a FizzBuzz server with GenServer, client APIs, callbacks, caching, and process-based I/O.
