On Tue, Feb 21, 2012 at 11:07 AM, Simon Sapin <simon.sa...@exyr.org> wrote:
> ... > So a super-set of WSGI that is not just a gateway but also does process > management? > > > @contextlib.contextmanager > def super_application(server_**infos): > with contextlib.closing(open_**resource()) as resource: > wsgi_callable = make_app(server_infos, resource) > yield wsgi_callable > I like this form a lot, but I think this is an implementation detail -- since we've not answered to the main question yet. Here's my attempt to formulate how I understand the problem at this point current assumptions/limitations: - the application can be shutdown without handling a request / which makes it orthogonal to the requests handling - the underlying code may use threads, making it unreliable to use atexit() - using signals may be problematic if some other code use it too -- for example the wsgi server itself -> the cleanest way seems to ask the web server itself to ping the wsgi app. problems: - how can we declare a shutdown entry point in the application, the web server can use. - how can this work with extra indirections (FASTCGI, etc) leads: - define startup/shutdown functions, declare them to the web server - use the existing environ to send a 'shutdown request' - Cheers Tarek -- Tarek Ziadé | http://ziade.org
_______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com