4 ms·
Yes and no. Like everything in Erlang, hot-swapping relies on code being structured as servers that responds to messages. In this case, the VM sends a message t
by bjourne 6y ago
Yes and no. Like everything in Erlang, hot-swapping relies on code being structured as servers that responds to messages. In this case, the VM sends a message to the process telling it about the code upgrade. The process has to handle this message "manually" and do what it needs with it. For example, changing its internal state or updating database schema if it uses external storage.
But you don't have to use the gen_server framework to accomplish this. It's perfectly fine (but not recommended as there are lots of details you want to get right) to write your own code for handling hot-swapping. See http://erlang.org/documentation/doc-4.9.1/doc/design_principles/gen_server.html http://erlang.org/documentation/doc-4.9.1/doc/design_princip... for some details on server principles.
Immutability in combination with Erlang's process centric view is what makes it possible.
- fulafel 6y agoThanks for the explanation. There's an idea in there for a Clojure library :)