Dynamic Code Loading
Dynamic code loading is one of the most surprising features built into the heart of Erlang. The nice part is that it just works without you really being aware of what’s happening in the background.
The idea is simple: every time we call
someModule:someFunction(...), we’ll always call the latest
version of the function in the latest version of the module,
even if we recompile the module while code is running in this
module.
If a calls b in a loop and we recompile
b, then a will automatically call the new
version of b the next time b is called.
If many different processes are running and all of them call
b, then all of them will call the new version of
b if b is recompiled. To see how this works, we’ll write two little ...
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