Hibernating a GenServer
I was reading a great blog post from @cloud8421 this morning and I learned that Elixir GenServer has the capability to hibernate
itself, which it means that it halts the continuous looping if there's no incoming message and it runs a garbage collection to release some memory generated by that process.
Use that with moderation, and it's always nice to evaluate if we really need to put a GenServer to hibernate, but in some cases it's very handy.
Tweet