
On Sep 15, 2004, at 12:26 PM, William Dode wrote:
James Y Knight <foom@fuhm.net> writes:
...
3) For distribution: twisted.web2 depends on Nevow (for static directory listings, and error pages), so will be distributed with it. Nevow recommends Twisted but does not require it for simple cases (e.g. flattening to a string from a CGI script), so there can also be a limited-functionality distribution of standalone Nevow.
What about the wsgi spec ? http://www.python.org/peps/pep-0333.html
It could be great if the server could not depend on any framework (i mean nevow).
The server would depend on Nevow in order to generate the HTML for various automatically generated pages, such as directory listings. I suggested to James that having a standalone twisted.web server that didn't depend on Nevow and wasn't capable of generating any pages itself would be possible, but James didn't think it was worth the effort. The WSGI spec is unsuitable for use with asynchronous servers and applications. Basically, once the application callable returns, the server (or "gateway" as wsgi calls it) must consider the page finished rendering. I have implemented a simple WSGI application callable in Nevow svn head, which will take a Page and synchronously render it. However, unless there is a way for the application to continue rendering after it has returned, I don't think this will be much use beyond just simple CGI style apps. I haven't mentioned anything about this to any WSGI list yet because I don't have a solution or a proposal. My initial thought is to have the start_response callable return a tuple of (write, finish) callables, instead of just write as it does now. I'm not yet sure this will actually work, though, so I'll have to give it further thought. dp