[erlang-questions] compile several modules from shell

Robert Raschke rtrlists@REDACTED
Tue Dec 1 11:47:20 CET 2009


On Tue, Dec 1, 2009 at 10:23 AM, Roberto Ostinelli <
roberto.ostinelli@REDACTED> wrote:

> dear all,
>
> as many of us are, i often use multiple nodes in my erlang
> applications. during development, all nodes reside on the same
> machine.
>
> fact is, when i compile a module on one of the nodes, the other nodes
> are erraticly updated with the freshly compiled module, even if it is
> not running [probably a cache of the loaded modules, i guess]. what i
> experience is that some nodes get updated, some others not, in a way i
> cannot figure a common pattern.
>
> therefore, the only thing i have figured out to do is to compile the
> module on the shell of all the running nodes, issuing the
> c(module_to_compile) command [which forces the refresh of the loaded
> modules].
>
> however, when i have to compile many modules, i find myself compiling
> all of them manually, repeatedly: c(module_1), c(module_2), .... on
> every node. this is annoying.
>
> my questions are:
>
> 1. is there another way to force the refresh [if this is the issue] so
> that, when i use a bash script to compile all modules all the nodes on
> the machine use the freshly compiled code?
> 2. otherwise, is ther a way to issue a shell compile on multiple
> modules [such as c(*) or such]?
>
> thank you,
>
> r.
>
>
Mochiweb contains a neat little module called reloader, which'll reload any
changed beam files that your node is aware of. Have a look at that, it might
fit your bill.

Robby


More information about the erlang-questions mailing list