<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jul 29, 2013, at 1:29 PM, Jorge Gonzalez <<a href="mailto:gjorge@google.com">gjorge@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-family: arial, sans-serif; font-size: 14px;">Wouldn't it be possible that <span style="font-family: 'courier new', monospace;">defer.gatherResults</span> inserts its callback into <span style="font-family: 'courier new', monospace;">d</span> before say <span style="font-family: 'courier new', monospace;">slowFuncReturningDeferred_B</span> gets to run and return its own Deferred (and therefore chain it to what gatherRestults is ultimately waiting for?). If so, wouldn't the results returned by <span style="font-family: 'courier new', monospace;">slowFuncReturningDeferred_B</span> never make it to the results gathered by <span style="font-family: 'courier new', monospace;">defer.gatherResults</span>?</div></blockquote></div><br><div>No, that's not what happens.  You call addCallback(lambda _: slowFunc...A()), then you call gatherResults.  That means gatherResult's callback is after slowFuncReturningA() in d's callback chain.</div><div><br></div><div>Can you attach an actual runnable code example with some behavior that you didn't expect, so we can actually run it and explain what's happening?  No need for you to spin the reactor or anything, just instantiate a Deferred and then fire it.</div><div><br></div><div>-glyph</div><div><br></div><div><br></div></body></html>