O'Reilly logo

Programming Elixir by Dave Thomas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required