Re: A 'shutdown' function in WSGI
Simon Sapin <[email protected]> Tue, 21 Feb 2012 11:07:06 +0100
| Newsgroups | gmane.comp.python.web |
|---|---|
| Message-ID | <[email protected]> |
Le 21/02/2012 10:31, Graham Dumpleton a écrit :
> You do realise you are just reinventing context managers?
>
> With this 'application' do requests.
Indeed. I didn’t want to go too far from the initial "shutdown function"
proposal, but actual context managers would be better.
Le 21/02/2012 10:38, Benoit Chesneau a écrit :
>> One might wonder if having access to process management should be part of
>> > WSGI in the first place.
>> >
> that's the thing. This is no more a gateway. Like I said in my
> previous post, maybe having another spec describing a web app package
> would do the trick?
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
--
Simon Sapin
_______________________________________________
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