[Twisted-Python] Question about RequestHandlers and inlinecallbacks

Andrew Francis andrewfr_ice at yahoo.com
Thu Jan 24 16:03:17 EST 2008

Hello Folks:

I am starting to learn inlinecallbacks. I am trying to
do the following:

from within a RequestHandler, I get a web page with
the client.getPage() method. I subsequently return the
web page to the requesting web browser.

The problem -

The web browser hangs. However the
requestHandler.writes are echoed to standard output
(or error).

The problem is that in process(self), a deferred is
created but process() ends finishes without outputting
anything to the web browser.

Eventually, the associated callback is triggered but
the request has already been serviced. 

What I really want is process() to wait until the
client.getPage() is finished.

What I am unclear about is how to properly structure
the programme to get the appropriate behaviour. I am
assuming this is possible. If so, what am I missing?

I have included some sample code.


Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: inlineExample.py
Url: http://twistedmatrix.com/pipermail/twisted-python/attachments/20080124/0cd97bbc/attachment.txt 

More information about the Twisted-Python mailing list