<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Mar 15, 2011, at 2:54 AM, Fantix King wrote:</div><br><blockquote type="cite"><div><div style="font-family:arial, sans-serif;border-collapse:collapse;font-size:13px">Thanks for replying! :)</div></div></blockquote><div><br></div><div>No problem, I wish I had time for more replies, but my stack runneth over.</div><div><br></div><blockquote type="cite"><div><div style="border-collapse:collapse;font-size:13px"><div><font face="'courier new', monospace"><b>--- &lt;asynchronous break point&gt; ---</b></font></div>


<div></div></div></div></blockquote><div><br></div><div>This is completely awesome, and I have had this message sitting around waiting for me to appropriately consider it and reply. &nbsp;Hopefully I'll have some time in the future though. &nbsp;Can you perhaps file a ticket in the Twisted tracker for "asynchronous tracebacks that show me what has happened to a Deferred" or something like that? &nbsp;I think that we've all been afraid that such a feature would have too high of a performance cost, but like the creation/invocation stacks that are used when Deferred debugging is on, we could at least make use of it in unit tests or in debug mode.</div><div><br></div><div>Thanks again for this awesome demonstration, and I'm sorry I haven't had more time to look at it.</div><br><blockquote type="cite"><div><div style="font-family:arial, sans-serif;border-collapse:collapse;font-size:13px">Additionally, in my&nbsp;scenario of a 5 years old asynchronous Twisted web application, we</div>


<div style="font-family:arial, sans-serif;border-collapse:collapse;font-size:13px">need the&nbsp;"request" object available&nbsp;throughout all code between asynchronous network</div>

<div style="font-family:arial, sans-serif;border-collapse:collapse;font-size:13px">accesses&nbsp;and database accesses&nbsp;because our global configuration system needs&nbsp;the</div><div style="font-family:arial, sans-serif;border-collapse:collapse;font-size:13px">


request&nbsp;object. It would greatly reduce our manual work to pass through the request</div><div style="font-family:arial, sans-serif;border-collapse:collapse;font-size:13px">object here&nbsp;and there to have a context working in the asynchronous way.</div>


</div></blockquote><br></div><div>Okay, _this_ sounds terrible to me. &nbsp;Implicitly requiring an out-of-band parameter that is retrieved via some global variable is a maintenance nightmare. &nbsp;This is one of the reasons I haven't written and published more about trying to do more with asynchronous context: I don't want idiomatic Twisted applications to become a big mess of spaghetti code which only works if your call stacks are all <i>just so.</i></div><div><i><br></i></div><div>Availability of an implicit/shared context object was one of the things that made maintaining old Woven and Nevow code such a pain, and I consider its complete elimination in twisted.web.template a major step forward. &nbsp;So let's not go down that road again :).</div><br></body></html>