[Web-SIG] WSGI - alternate ideas, part II
Michael C. Neel
neel at mediapulse.com
Thu Sep 16 15:41:07 CEST 2004
On Wed, 2004-09-15 at 23:27, Phillip J. Eby wrote:
> At 11:06 PM 9/15/04 -0400, Peter Hunt wrote:
>
> >Thus, here is my "WSGI-X" proposal. The application will call the
> >gateway, opposite of WSGI. For example, a CGI WSGI-X application may
> >begin with:
> >
> >#!/usr/bin/env python
> >if __name__ == "__main__":
> > from wsgix import cgi
> > req = cgi.get_request()
>
> That's pretty hard to implement correctly in any number of
> servers. Really, pretty much every server wants to call the application,
> rather than the other way around, because servers want to use their own
> event loop.
To insert my highly unqualified 2 cents; this is simialr to the way
SnakeSkin/Albatross work:
import snakeskin
from snakeskin.cgiapp import Request
app = snakeskin.SimpleApp(...)
app.run(Request())
....
which allows me a chance to do something like:
app = snakeskin.SimpleApp(...)
myReq = Request()
myReq.custom_data = {...}
app.run(myReq)
changing to mod_python, chane line two to
from snakeskin.apacheapp import Request
the rest is the same. I don't think there is an issue with the current
wsgi where app is callable; calling the object would just imply a:
from snakeskin.wsgiapp import Request
Mike
More information about the Web-SIG
mailing list