[Twisted-web] Twisted and WSGI...

Jim Fulton jim at zope.com
Wed Apr 5 14:04:21 CDT 2006


m h wrote:
> Hi Folks-
> 
> I'm new to this list.  (Am beginning to think more about learning
> twisted... for the third time ;) ).  I've got a question for you all
> and hope that you don't take it the wrong way.  It's not meant to be
> flame bait.

I'm not a Twisted developer, so no worries. :)

> As WSGI is going into python 2.5, I was wondering what the general
> consensus is among twisted web devs about it?  Does the WSGI model map
> well into twisted's asynchronous model? 

Not as well as it should IMO.  There seems to be some disdain
for asynchronous servers on the WSGI list.  I tried to
advocate on the WSGI list for better support for asynchronous
servers, especially wrt threading issues.

> Does twisted already have
> everything it needs, so WSGI doesn't bring much to the table?

WSGI makes it much easier for applications to leverage Twisted,
so it increases Twisted's potential user base.

> It appears that as AJAX becomes more popular then the asynchronous
> model might scale better with many small requests. 

An asynchronous model works well for many requests period,
whether they are large or small.

> Say I have a WSGI
> app and I want to port it to twisted.  How easy is that?  (I know
> there is a twisted wsgi module)

Trivial.

>  Do I just need to wrap some logic in deferreds?

No. You don't have to do any twisted programming at all to use the
web server via WSGI.

IMO, to get the full scalability benefits you want, you may
need to address some threading issues.  You might look at the
Zope 3 integration, which isn't as clean as it ought to me.

> Are any twisted people using WSGI?

I don't know. Zope 3 is using it. Zope 2 will be using it in
the future.  I don't think we count as Twisted people.
(Although we might count as twisted people. ;)

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the Twisted-web mailing list