typicode / katon

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

ability to restart app process #39

Closed ajb closed 10 years ago

ajb commented 10 years ago

similar to touch tmp/restart.txt in pow, or powder restart in powder.

typicode commented 10 years ago

Yes, good idea. I've added katon touch in v0.6.4.

assaf commented 10 years ago

What does it touch?

typicode commented 10 years ago

touch ~/.katon/hosts/<app_name>.json katon is monitoring these files and reloads server configuration. It should be noted though that the server is stopped and you need to make a request to get it started (same behavior as katon rm && katon add ...)

assaf commented 10 years ago

I see. In that case I would suggest picking a more appropriate name for this command, such as "restart" or "kill".

There are two common touch abstractions:

Both are "touch" abstraction because you're expected to either touch a file, or write code that responses to a file that's touched. In both cases "touch" describes what it does.

In Katon's case, however, "touch" doesn't describe what it does, but how it does it. And that's why I think the name is inadequate. I care to know what the command does. Whether it uses file touching, or signals, or sockets, those are just implementation details.

You can tell when it's the right abstraction if the command name remains the same (e.g. katon kill) even as the implementation changes from using one mechanism to another (e.g. from touch to signal).

As for what would be a better name, if I understand it correctly, this command effectively kills the server, so that would be the most appropriate name.

ajb commented 10 years ago

:+1: assaf

On Mon, Oct 13, 2014 at 12:09 PM, Assaf Arkin notifications@github.com wrote:

I see. In that case I would suggest picking a more appropriate name for this command, such as "restart" or "kill".

There are two common touch abstractions:

  • The server is watching a file (e.g. restart.txt), the developer touches that file to restart the server
  • The developer's own code is watching files for changes (typically reload server), something else is expected to touch one of these files

Both are "touch" abstraction because you're expected to either touch a file, or write code that responses to a file that's touched. In both cases "touch" describes what it does.

In Katon's case, however, "touch" doesn't describe what it does, but how it does it. And that's why I think the name is inadequate. I care to know what the command does. Whether it uses file touching, or signals, or sockets, those are just implementation details.

You can tell when it's the right abstraction if the command name remains the same (e.g. katon kill) even as the implementation changes from using one mechanism to another (e.g. from touch to signal).

As for what would be a better name, if I understand it correctly, this command effectively kills the server, so that would be the most appropriate name.

— Reply to this email directly or view it on GitHub https://github.com/typicode/katon/issues/39#issuecomment-58914922.

Adam Becker 510.928.9111 @AdamJacobBecker