[Twisted-Python] Re: Converting async to sync code (blocking until deferreds fire)

Don Dwiggins ddwiggins at advpubtech.com
Tue Jul 22 13:07:22 EDT 2008


Jack Whitham wrote:
> 3. yield
>    Since my program is not multithreaded and not a test case,
>    the use of yield is most suitable. Here is how yield is used
>    in this context:
>    http://twistedmatrix.com/documents/8.1.0/api/twisted.internet.defer.html#inlineCallbacks
>    This does have some restrictions, not least that Python 2.5 is
>    needed. 

If that's a problem for you, there's also a 2.4 equivalent, which I've 
been using successfully.  Check out
http://twistedmatrix.com/documents/8.1.0/api/twisted.internet.defer.html#deferredGenerator 



-- 
Don Dwiggins
Advanced Publishing Technology





More information about the Twisted-Python mailing list