valum-framework / valum

Web micro-framework written in Vala
https://valum-framework.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
225 stars 23 forks source link

Handle SIGTERM interrupt #173

Closed arteymix closed 8 years ago

arteymix commented 8 years ago

VSGI.Server should handle theSIGTERM by calling quit.

For FastCGI and SCGI, there is already some proper teardown performed, but this is only triggered if the application quit by itself.

For FastCGI, it's possible to set RequestFlags.FAIL_ACCEPT_ON_INTER so that an accept call fails if a SIGINT is received. It might be necessary to check the signal as well in the loop.

It might be nice to integrate a cancellable API with #165.