On 4/18/06, <b class="gmail_sendername">Brian Granger</b> &lt;<a href="mailto:bgranger@scu.edu">bgranger@scu.edu</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have run into this issue as well when trying to order different<br>writes and make code run _after_ a write was completed.&nbsp;&nbsp;I ended up<br>calling my code using deferToThread and putting in time.sleep calls to<br>make sure things got ordered correctly.&nbsp;&nbsp;Ugly hack though.
<br><br>The ITransport interface docs seem to imply that returning a deferred<br>from a write is not supported:<br><br>I make no representations about whether calls to me will happen<br>immediately or require returning to a control loop, or whether they
<br>will happen in the same or another thread. Consider methods of this<br>class (aside from getPeer) to be 'thrown over the wall', to happen at<br>some indeterminate time.<br><br>I echo the question: why doesn't write return a deferred?&nbsp;&nbsp;Surely
<br>there are times you want to trigger events on the completion of a<br>write.</blockquote><div><br><br>The way you do this is to hook up a producer to the transport. Hopefully there are some references to this in the API docs: search for &quot;producer&quot; and &quot;consumer&quot;. 
<br></div><br></div><br>-- <br>Christopher Armstrong<br>International Man of Twistery<br><a href="http://radix.twistedmatrix.com/">http://radix.twistedmatrix.com/</a><br><a href="http://twistedmatrix.com/">http://twistedmatrix.com/
</a><br><a href="http://canonical.com/">http://canonical.com/</a><br>