0

When I modify a .yaws file it take a few (5, 10) seconds for changes to take effect, it it normal and Do I have to keep terminal open while I use YAWS server?

  • Modifying a `.yaws` file causes the Yaws runtime to have to recompile it and reload it. This takes time of course, but it shouldn't take as long as you say. What does your `.yaws` file do? If you'd like you can file a [Yaws issue on github](https://github.com/klacke/yaws/issues) and include a test case, and I or another Yaws contributor will have a look. – Steve Vinoski Jan 27 '16 at 17:36
  • I am new to erling and yaws it is unlike apache and php, your answer make sense, I didn't know that it compiles erling code on run time... thank you! –  Jan 27 '16 at 18:52
  • Also, you don't need to keep a terminal open if you run Yaws in daemon mode, using the `--daemon` option. – Steve Vinoski Jan 27 '16 at 19:51
  • @SteveVinoski if you can write your comments as an answer I would vote up and mark it as answered ! –  Jan 28 '16 at 08:59

1 Answers1

1

When you modify a .yaws file, Yaws recompiles it to an Erlang .beam file, which contains bytecode for the Erlang virtual machine, and reloads it. This won't be instantaneous of course, but it should not take 5-10 seconds; you should report a Yaws issue in that case, and please include a test case.

As for requiring a terminal, Yaws can run such that it gives you an interactive Erlang shell, or it can be run as a background daemon if you supply the --daemon command-line option. Yaws comes with a number of startup scripts for running it as a daemon on various operating systems.

Steve Vinoski
  • 19,847
  • 3
  • 31
  • 46