typicode / katon

(use hotel instead)
https://github.com/typicode/hotel
MIT License
683 stars 28 forks source link

pause / resume commands #60

Closed kylemac closed 9 years ago

kylemac commented 9 years ago

I'm curious as to whether you think having katon pause and katon resume would be valuable options. the objective here would be turning a server "off" (potentially saving resources) w/o losing it's configuration, as you would with katon rm.

I'm new to the project, so there may be architectural reasons this doesn't make sense - but I'm willing to contribute this if you thought it was worthwhile.

typicode commented 9 years ago

No worries and thanks for the proposition :). Well I don't think it's needed but it's the sign that it should be better explained in the README or katon reload should maybe be renamed (because I often get this question :)).

Actually, when you run app$ katon add server is added but not started. When you make the first request to app.ka, katon starts app for real and proxy request. If no request is made to app for more than an hour, then katon automatically stops app.

So katon automatically manages resources by starting only needed servers and stopping them when they're not used.

There's katon reload too which reloads the current config and also stops the server. Basically:

$ katon reload # same as katon rm && katon add 'same config'