When you start Yaws, it ultimately refers to your myappmod2
module, causing the Erlang runtime to load the beam file created by compiling the module. After downloading it, it remains loaded until you reboot it, for example, through the Erlang interactive shell, or stop and restart Yaws and Erlang runtime. Just recompiling the module from the outside does not restart it.
If you launch Yaws interactively via yaws -i
, you can press enter after launch to get the Erlang interactive shell. If you change the appmod module and recompile it, make sure you copy the new beam file over the old one, and then just type l(myappmod2).
into the interactive shell, and then press enter to reload the myappmod2
module (and don't forget the period after the closing bracket). This lowercase l
is the Erlang shell load command . You can also compile the module directly in the shell using the c(myappmod2).
command c(myappmod2).
, which will compile and load it (in the absence of compilation errors).
If you have Yaws that does not work interactively, say, like a normal background daemon process, you can reload the modules into it by running the following command:
yaws --load myappmod2
You can put several module names after the --load
option if you want to load them all at once. If your Yaws instance has a specific identifier, make sure that you also use the corresponding --id
parameter to identify it.
If you are interested in reloading the recompiled modules, you can look at something like the reloader.erl module, which monitors the recompiled modules and loads them automatically. I would not recommend it for use in production, but it can be useful for development.
source share