otp-thinking
Installation
SKILL.md
OTP Thinking
Resumo (pt-BR): GenServer é gargalo por design (um processo, uma mensagem por vez). Use ETS para leituras paralelas. Task.Supervisor em produção, não Task.async. Broadway = filas externas; Oban = jobs em DB.
Paradigm shifts for OTP design. These insights challenge typical concurrency and state management patterns.
The Iron Law
GENSERVER IS A BOTTLENECK BY DESIGN
A GenServer processes ONE message at a time. Before creating one, ask: Do I need serialized access? Will this become a throughput bottleneck? Can reads bypass the GenServer via ETS?
The ETS pattern: GenServer owns ETS table; writes serialize through GenServer; reads bypass with :read_concurrency. Don't wrap stateless functions in GenServer.