amethyst-framework / amethyst

Amethyst is a Rails inspired web-framework for Crystal language
https://github.com/amethyst-framework
MIT License
649 stars 46 forks source link

Daemonizing\Forking #28

Open bararchy opened 9 years ago

bararchy commented 9 years ago

We need to add some option to "run in the background".

we can use fork

fork do
  app.serve
end

or some internal design to this this thing.

sdogruyol commented 9 years ago

Why do we need this ?

bararchy commented 9 years ago

Because unlike rails (Ruby), you cannot install a Crystal addon into apache or nginx , which means that you can only use Crystal's HTTP::Server , this in turn means that we need an option to start our programs as a service in the background without the need to relay upon VT environment and so we can initiate it via Systemd or init .

for all of those we need the bin to be able to start as a service

sdogruyol commented 9 years ago

Actually we don't install any addon to apache / nginx in Ruby world.

We mostly use Nginx / Apache as a reverse proxy and static file server other than that we have Ruby web servers (Puma, Thin, Unicorn e.g) which handles the incoming requests.

bararchy commented 9 years ago

@Sdogruyol Thats cool to know, but it doesn't change the fact that we need to add a fork or app.serve_in_background option

kbrock commented 9 years ago

Docker and mac LaunchAgents only work if you run in the foreground. Systemd can work either way.

I agree that this used to be the only way to run, but now a days I wonder. What environment are you running?