jc00ke / guard-puma

Restart puma when files change
MIT License
50 stars 19 forks source link

Use the state file to allow faster/better restarts #5

Closed docwhat closed 12 years ago

docwhat commented 12 years ago

You're using the PID to restart puma, you should use the state file to restart instead...

To see what it looks like with out guard, start puma with these options:

puma --port 4000 -S /tmp/puma.state --control auto

Then in another shell do:

pumactl -S /tmp/puma.state restart

Instead of having to wait for it to die and then restart it, this happens very quickly.

If you want to actually call this from within ruby, you can look at lib/pum/control_cli.rb to see how it works.

I took a quick look at your code, but I wasn't sure how to go about modifying it, or I'd have submitted a pull request.

Ciao!

jc00ke commented 12 years ago

Thanks for the suggestion! I wasn't happy with how long restarts were taking before, so good timing.

I'm refactoring the code now. I hope to have pumactl working soon.

jc00ke commented 12 years ago

I decided to use the status server instead of the state file. I started going down the pumactl route but the status server was easier.