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
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

Reply via email to