Re: A 'shutdown' function in WSGI
Tarek Ziadé <[email protected]> Tue, 21 Feb 2012 09:23:38 +0100
| Newsgroups | gmane.comp.python.web |
|---|---|
| Message-ID | <CAGSi+Q5rhbLDq89WurpHGfpVD=jVb4dj9-=BWGWRS0s8d76CeQ@mail.gmail.com> |
On Tue, Feb 21, 2012 at 8:56 AM, Simon Sapin <[email protected]> wrote: > Le 21/02/2012 08:47, Tarek Ziadé a écrit : > > Yes, I also think shutting down the server is completely orthogonal to >> requests. >> > > If the shutdown callback is next to the application and not registered in > a request, why not also have the symmetric "server start up" callback that > would not wait for a request? This would avoid workarounds like > Flask.before_first_request. > > Both of these callbacks could be called once per process (aka. space where > requests share memory.) > > Fair point, > Instead of having to provide two or three objects separately to a server, > how about making the callbacks attributes of the application callable? > can you show us an example ? > Regards, > -- > Simon Sapin > -- Tarek Ziadé | http://ziade.org _______________________________________________ Web-SIG mailing list [email protected] Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org