[Twisted-Python] sleeping in inlineCallbacks
ellisonbg.net at gmail.com
Wed Oct 28 17:48:59 EDT 2009
I have been using Twisted for years but only recently began to use
inlineCallbacks (couldn't give up Python 2.4 support until recently). This
simple asynch. sleep function is fantastic. Just today I used to it with
inlineCallbacks to dramatically clean up some complex deferred logic.
On Wed, Oct 7, 2009 at 8:28 PM, Andrew Bennetts <andrew at bemusement.org>wrote:
> Mikhail Terekhov wrote:
> > On Wed, Oct 7, 2009 at 6:04 PM, Phil Christensen <
> phil at bubblehouse.org>
> > wrote:
> > Paul's example will work just fine. Also, AFAIK there's no existing
> > twisted function to do replicate an asynchronous sleep() in this
> > -phil
> > What about Deferred.setTimeout?
> > 
> > IMHO it solves similar problem.
> Deferred.setTimeout is a poor API and is deprecated (despite what the
> automatically generated API docs think).
> <http://twistedmatrix.com/trac/ticket/178> has some discussion (and links
> more discussion) explaining what's wrong with it, and what a good
> would look like.
> So please, don't use setTimeout, and definitely do not recommend it to
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python