<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Otp on DanielWS</title><link>https://daniel.ws/tags/otp/</link><description>Recent content in Otp on DanielWS</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 16 May 2026 14:10:51 -0300</lastBuildDate><atom:link href="https://daniel.ws/tags/otp/index.xml" rel="self" type="application/rss+xml"/><item><title>GenServer the "rabbit hole" — Part 2: The Silent Cascade</title><link>https://daniel.ws/posts/genserver-the-rabbit-hole-part-2-silent-cascade/</link><pubDate>Sat, 16 May 2026 14:10:51 -0300</pubDate><guid>https://daniel.ws/posts/genserver-the-rabbit-hole-part-2-silent-cascade/</guid><description>&lt;blockquote>
&lt;p>Continuation of &lt;a href="https://daniel.ws/posts/genserver-the-rabbit-hole/">GenServer the &amp;ldquo;rabbit hole&amp;rdquo;&lt;/a>. If you haven&amp;rsquo;t read it yet, I recommend going there first — we&amp;rsquo;ll start from the same &lt;code>genserver_study&lt;/code> project and the same concepts of mailbox, supervisor and &lt;code>max_restarts&lt;/code>.&lt;/p>&lt;/blockquote>
&lt;p>In the previous article we explored how a &amp;ldquo;misbehaving&amp;rdquo; GenServer can shut down the whole supervision tree when it bursts the supervisor&amp;rsquo;s &lt;code>max_restarts&lt;/code>. We showed how messages are lost in the mailbox and how &amp;ldquo;Let it crash&amp;rdquo; isn&amp;rsquo;t exactly a blank check to let processes break randomly.&lt;/p></description></item><item><title>GenServer — the "rabbit hole"</title><link>https://daniel.ws/posts/genserver-the-rabbit-hole/</link><pubDate>Sat, 19 Jul 2025 13:36:37 -0300</pubDate><guid>https://daniel.ws/posts/genserver-the-rabbit-hole/</guid><description>&lt;p>When we explore Elixir&amp;rsquo;s strengths as a programming language, two stand out compared to other languages on the market:&lt;/p>
&lt;blockquote>
&lt;h3 id="-3-concurrency-and-scalability">🚀 3. &lt;strong>Concurrency and Scalability&lt;/strong>&lt;/h3>
&lt;ul>
&lt;li>Uses &lt;strong>actors (processes)&lt;/strong> for concurrency (each with its own memory and message queue).&lt;/li>
&lt;li>Millions of processes can run concurrently with &lt;strong>low overhead&lt;/strong>.&lt;/li>
&lt;li>Built-in tools for &lt;strong>distribution across multiple nodes&lt;/strong>.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="-4-fault-tolerance-and-supervision-trees">🛠 4. &lt;strong>Fault-Tolerance and Supervision Trees&lt;/strong>&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>&amp;ldquo;Let it crash&amp;rdquo; philosophy&lt;/strong>: Failures are expected and isolated.&lt;/li>
&lt;li>&lt;strong>Supervision trees&lt;/strong>: Automatically restart failing processes, making systems &lt;strong>self-healing&lt;/strong> and resilient.&lt;/li>
&lt;/ul>&lt;/blockquote>
&lt;p>GenServer is an abstraction over the Erlang VM&amp;rsquo;s process model, shipped by the language core, that connects directly to Elixir&amp;rsquo;s &lt;strong>concurrency and supervision tree&lt;/strong> features. Because it&amp;rsquo;s a common pillar in the architecture of Elixir systems, and because it&amp;rsquo;s covered &amp;ldquo;prematurely&amp;rdquo; in the official docs (&lt;a href="https://hexdocs.pm/elixir/1.18.4/genservers.html">Client-server communication&lt;/a>, &lt;a href="https://elixirschool.com/en/lessons/advanced/otp_concurrency">OTP Concurrency&lt;/a>), newcomers tend to model their first Elixir solutions using the abstraction provided by the &lt;code>GenServer&lt;/code> module. It takes a while before the official doc gets to its first disclaimer for the unaware: &lt;a href="https://hexdocs.pm/elixir/1.18.4/GenServer.html#module-when-not-to-use-a-genserver">When (not) to use a GenServer&lt;/a>.&lt;/p></description></item></channel></rss>