diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-10-25 16:14:49 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-10-26 02:26:22 -0700 |
commit | 8487d928f9581d98aee14e1991f129422278367c (patch) | |
tree | 04eb15c1f8494e948d9b9882ecf4371c77b04536 /lib/rainbows/ev_core.rb | |
parent | 344f8cf1e000704d53d7841eb896d83b470d7a08 (diff) | |
download | rainbows-8487d928f9581d98aee14e1991f129422278367c.tar.gz |
Graceful quit means we finish sending everything we have before exiting. Additionally, only signal quits after we've queued the error response up.
Diffstat (limited to 'lib/rainbows/ev_core.rb')
-rw-r--r-- | lib/rainbows/ev_core.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/rainbows/ev_core.rb b/lib/rainbows/ev_core.rb index aa0b155..d8304a3 100644 --- a/lib/rainbows/ev_core.rb +++ b/lib/rainbows/ev_core.rb @@ -19,12 +19,10 @@ module Rainbows # graceful exit, like SIGQUIT def quit - @deferred_bodies.clear @state = :close end def handle_error(e) - quit msg = case e when EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,Errno::EBADF ERROR_500_RESPONSE @@ -36,6 +34,7 @@ module Rainbows ERROR_500_RESPONSE end write(msg) + quit end def tmpio |