Re: Nevow instead of twisted.web

Jean-Paul Calderone <[email protected]> Fri, 2 Nov 2007 17:24:09 -0500
Newsgroups gmane.comp.python.quotient.dev
Message-ID <20071102222409.8162.903690939.divmod.quotient.30998@ohm>
On Fri, 02 Nov 2007 16:52:24 -0400, "David S." <[email protected]> wrote:
>I am trying to get an understanding of Nevow for a web app built on--- 
>appropriately enough---an asynchronous back end.   Our current prototype is 
>built on twisted.web but we want a more restful api and easier framework to 
>work with.
>Should I be working from trunk or 0.9.18?  The docs and examples all refer 
>to livepage, for example, but the wiki says it is deprecated and to use 
>athena.   So if I stick with 0.9.18 can I just s/livepage/athena?
>
>Also, I wonder if I am even on the right track in exploring the livepage 
>stuff.  Is that, indeed, the mechanism that nevow uses to replace 
>NOT_DONE_YET as in twisted.web, or are there alternatives that I have not 
>noticed yet?

Nevow uses Deferreds instead of NOT_DONE_YET.  Athena and LivePage are mainly
pushing messages from the server to a browser at some point after the initial
page render has finished.

If you just need to do with Nevow what you were doing with NOT_DONE_YET and
twisted.web, you might be able to get away with something as simple as
returning a Deferred from renderHTTP and then calling it back with a string
of your result.  There are more advanced uses which give you incremental
rendering and let you keep peak memory usage lower, too, if you need that.

Jean-Paul