<pre><br>Hello and thanks for your time.<br><br>Regards,<br><br><br></pre><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">I&#39;ve already written this some times:<br>
<br>d1.addCallback(5, reactor.callLater, d2.callback, &quot;firelater&quot;)<br><br>Hope this, helps,<br><br>-- <br>Amaury Forgeot d&#39;Arc<br><br></blockquote><blockquote><br><br><div class="gmail_quote">On Tue, Dec 16, 2008 at 5:29 PM, Arye <span dir="ltr">&lt;<a href="mailto:aryeh@bigfoot.com">aryeh@bigfoot.com</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;">Dear list,<br><br>I would like to add a callback that delays the chain. In other words I would like to combine:<br>
defer.Deferred().addCallback<br>and reactor.callLater <br><br>The only solution I came up with was the code below.<br>
<br>There must be a more elegant way to do this.<br>Any ideas would be greatly appreciated,<br>All the best,<br><br>*************************begin<br>from twisted.internet import reactor, defer<br><br>def printResults(results, arg):<br>

&nbsp;&nbsp;&nbsp; print &quot;In printResults results=&quot;, results<br>&nbsp;&nbsp;&nbsp; print &quot;In printResults arg=&quot;, arg<br>&nbsp;&nbsp;&nbsp; if arg == 2:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reactor.stop()<br><br><br>def fireLater(results, d2):<br>&nbsp;&nbsp;&nbsp; print &quot;In fireLater results=&quot;, results<br>

&nbsp;&nbsp;&nbsp; reactor.callLater(5, d2.callback, &quot;firelater&quot;)<br><br>d1 = defer.Deferred()<br>d2 = defer.Deferred()<br>d2.addCallback( printResults, 1)<br>d2.addCallback( printResults, 2)<br><br><br>d1.addCallback(fireLater, d2)<br>

d1.callback(&quot;fire&quot;)<br><br>reactor.run()<br>*************************end<br>
</blockquote></div></blockquote><br>