lotus/lotus — pull request #86 by jodosha (2014-12-05 11:31:38+00:00)
Title: Code reloading

Introduce code reloading with `lotus server`.

All the Lotus frameworks are designed to freeze the code and their configurations when `Lotus::{Model,View,Controller}.load!` is invoked. They don't support code reloading. The reason is to make them to behave equally across the environments. This eliminates uncertainty: the code is always frozen.

However, code reloading is a great feature to have during the development time.

This proposal changes the way that `lotus server` command works. It forks the process for each incoming request. The fork causes the code to be reload, so the application code changes are visible to the new request. It internally uses `shotgun` gem.

This also changes the internal Rack middleware stack that it uses:

* `Rack::ContentLength`
* `Rack::CommonLogger`
* `Rack::ShowExceptions`
* `Rack::Lint`

That means that starting from now `lotus server` SHOULD NOT be used for deployment purposes.

Application containers like Thin/Unicorn/Puma/Passenger are able to start the process from a Rack configuration file (`config.ru`). Their specific commands SHOULD be used to deploy Lotus applications.

Closes #24