<div dir="ltr"><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
I have no concrete solution to what you describe, but I can try and<br>
explain how Deferreds work.<br><div class="Ih2E3d"><br>
</div>The crucial thing is that &quot;someone&quot; or &quot;something&quot; must call the<br>
callback method on your Deferred. The general rule to follow is that<br>
it is the code that creates a Deferrred which has the reponsibility of<br>
calling the callback method at the correct time.<br><br>
So when you use the getPage function you get a Deferred back. Behind<br>
the scenes the getPage function has setup things in such a way that<br>
the callback method of the returned Deferred is called when the page<br>
has arrived -- you must not invole callback yourself in this case.<br><br>
But if you create a Deferred yourself, then it is up to you to make a<br>
call to the callback method when ready.<br><br><div id=":2qn" class="ArwC7c ckChnd"><br>
I hope this helps a bit -- it helped me to look at the implementation<br>
in defer.py and see that it was less scary than I had imagined :-)<br>
<br>
<br>
--<br>
Martin Geisler</div></blockquote><div><br>Martin<br>&nbsp;<br></div>Thanks for the reply.<br>
<br>
That does clarify that I need to fire off my own deferreds.<br>
<br>
The problem it leaves me at the moment is:<br>
<br>
How do I tell when my transport.write has completed. The ACKs for my
messages happen at the TCP level. Does this mean that for writes and
reads I have to work at the application level to register when the
write has been successful and fire my callback then.<br><br>By the way I did find your example, but I could not reconcile why some deferred examples had &#39;automatic&#39; callbacks and other fired their own.<br><br>Yes. I have looked through the defer.py code to see what was going on. It is certainly well laid out and easy to follow - just the basic concept needed clearing up.<br>
<br>Thanks<br><br>John Aherne<br><br><br>
</div>