Hot Code-Swapping
You may have heard that OTP applications can update their code while they are running. It’s true. In fact, any Elixir program can do it. It’s just that OTP provides a release-management framework that handles it.
However, OTP release management is complex. Something with the potential to deal with dependencies between thousands of processes on hundreds of machines with tens of thousands of modules will, by its nature, be bigger than a breadbox.
However, I can show you the basics.
First, the real deal is not swapping code, but rather swapping state. In an application where everything runs as separate processes, swapping code simply means starting a process with the new code and then sending messages to it.
However, server ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access