small medium large xlarge

18 Oct 2015, 15:16
Cherrot Luo (1 post)

In OTP:Servers (page 491), Dave said:

The VM doesn’t hot-swap code until you explicitly access it by module name. So, to try our new functionality we’ll create a new server.

However in my test, when I have recompiled the Sequence.Server module by r Sequence.Server, I could immediately invoke GenServer.cast(pid, {:increment_number, 100}) . It seems that the VM would hot-swap code automatically, so there is no need to start a new server.

Is this because of an Elixir or Erlang updates, or an error in the book?

Following is my Elixir/Erlang version:

Erlang/OTP 18 [erts-7.0.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] Interactive Elixir (1.0.5)