I have been using Twisted for years but only recently began to use inlineCallbacks (couldn&#39;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.  Thanks,<br>
<br>Brian<br><br><div class="gmail_quote">On Wed, Oct 7, 2009 at 8:28 PM, Andrew Bennetts <span dir="ltr">&lt;<a href="mailto:andrew@bemusement.org">andrew@bemusement.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Mikhail Terekhov wrote:<br>
&gt;    On Wed, Oct 7, 2009 at 6:04 PM, Phil Christensen &lt;[1]<a href="mailto:phil@bubblehouse.org">phil@bubblehouse.org</a>&gt;<br>
<div class="im">&gt;    wrote:<br>
&gt;<br>
&gt;      Paul&#39;s example will work just fine. Also, AFAIK there&#39;s no existing<br>
&gt;      twisted function to do replicate an asynchronous sleep() in this way.<br>
&gt;<br>
&gt;      -phil<br>
&gt;<br>
&gt;    What about Deferred.setTimeout?<br>
</div>&gt;    [2]<a href="http://twistedmatrix.com/documents/current/api/twisted.internet.defer.Deferred.html#setTimeout" target="_blank">http://twistedmatrix.com/documents/current/api/twisted.internet.defer.Deferred.html#setTimeout</a><br>

<div class="im">&gt;    IMHO it solves similar problem.<br>
<br>
</div>Deferred.setTimeout is a poor API and is deprecated (despite what the<br>
automatically generated API docs think).<br>
&lt;<a href="http://twistedmatrix.com/trac/ticket/178" target="_blank">http://twistedmatrix.com/trac/ticket/178</a>&gt; has some discussion (and links to<br>
more discussion) explaining what&#39;s wrong with it, and what a good replacement<br>
would look like.<br>
<br>
So please, don&#39;t use setTimeout, and definitely do not recommend it to others!<br>
<font color="#888888"><br>
-Andrew.<br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</div></div></blockquote></div><br>