[Web-SIG] A 'shutdown' function in WSGI

Sylvain Hellegouarch sh at defuze.org
Tue Feb 21 09:25:32 CET 2012


>
>
> Yes, I also think shutting down the server is completely orthogonal to
> requests.
>
>

CherryPy is using an approach where, indeed, both are orthogonal. Tools
[1], which are similar to middlewares, are dealing with requests whereas
the CherryPy engine [2] is the basis upon which the whole application and
HTTP servers are running. The engine provides, amongst others, a clean way
to stop and/or exit the whole stack independently from running requests.
However, due to the way Robert Brewer designed it, it also means this can,
if wanted, be performed from a request handler at any time. Note that the
engine architecture, a bus, allows obviously for functions to subscribe at
the time the engine shuts down in order to perform further operations that
you would require.

Robert has also started the work of extracting the engine from CherryPy
itself for other frameworks to rely on [3].

-- 
- Sylvain
http://www.defuze.org
http://twitter.com/lawouach

[1] http://docs.cherrypy.org/stable/concepts/tools.html
[2] http://docs.cherrypy.org/stable/concepts/engine.html
[3] https://bitbucket.org/cherrypy/magicbus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/web-sig/attachments/20120221/f23d8cb0/attachment.html>


More information about the Web-SIG mailing list