metabahn/pakyow — pull request #42 by tessellator (2012-02-17 01:58:31+00:00)
Title: HTTP Server Shutdown on Interrupt and Terminate Signals

I added a method to shut down the HTTP server gracefully when a Ctrl+C is received after calling 'pakyow server'. This removes the need for having to use 'kill -9 {pid}' while developing.

I manually tested it with thin, mongrel, and WEBrick, but there is also a case for future (unknown) server types.

Handles both :INT and :TERM.

This is a reissue of pull request #41 to the release branch.