How to Hot Reload the changed OTP impl code ,during dev mode for easy testing?

Lets say, if we are working on pretty big applications,
ets , genserver, events , fsm → otp etc…

While running the application with iex -S mix,
It is required to do some changes in the code and check its working at runtime.
It is required that the changes done in my code get recompiled
and take the new code, only the changed files.

Either through opening a new terminal , doing some task with mix.
That reloads and recompiles the changed OTP impl, And restart them, So
It is not required to do with iex -S mix , as

the application takes considerable amount of
time to start . And to test run time is required .

The recompile(module.ex) cmd, only realods, but whole module name is required to reload those changes,
but that also has to be done through iex.

If I got this right, it seems like you’re looking for something like Phoenix Live Reload for a non-Phoenix app. I’d look at the sources and try to reimplement that for your app (to simplify: use a filesystem watcher to detect the changes and recompile the app).

1 Like