[Web-SIG] WSGI uses
Phillip J. Eby
pje at telecommunity.com
Thu Aug 19 07:28:30 CEST 2004
At 11:50 PM 8/18/04 -0500, Ian Bicking wrote:
>I was playing around with making a WSGI server, and I'm starting to think
>that some really neat stuff could be done with middleware.
Indeed. In recent months, when I was refactoring peak.web to remove its
dependency on Zope X3, I came up with a variant of the current WSGI
interface as a strictly internal coupling mechanism for peak.web. It
turned out to be a delightfully simple way to connect internal
components. A peak.web user had previously complained about the difficulty
of wrapping arbitrary postprocessing around pages, so I invented a more
"functional" protocol for coupling peak.web components. The main
difference between it and WSGI now, was that it returned the status,
headers, and iterator all in one tuple. Tony Lownds proposed the write =
start_response(status,headers) part, and I merged it with returning an
iterator to form the new interface. It's a reasonably lightweight API for
both the server and application sides, but it's *remarkably* lightweight
for middleware.
More information about the Web-SIG
mailing list