<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 5, 2013 at 12:00 PM, Maciej Wasilak <span dir="ltr"><<a href="mailto:wasilak@gmail.com" target="_blank">wasilak@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Laurens,<br> <br></div><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div dir="ltr">
<div><div class="gmail_extra"><div class="gmail_quote"><div>You don't have to do it from in there. You can do .addErrback(handleErrors, request), since it's all the same request object, right?<br></div></div></div>


</div></div></blockquote><div><br></div></div><div>Aaargh! I see the problem now. I wrote everything as part of the Protocol class (D&D - Deferreds&Dictionaries), when I should have extracted request functionality into separate class. Then I can save request body as a class member between callback and errback. Thanks!!!</div>

<div class="im"></div></div></div></div></blockquote><div><br></div><div>Well, yes, you should, but still keep in mind that you can actually just pass the request like so:<br><br></div><div>.addErrback(handleErrors, request)<br>

<br></div><div>You don't really have to save the request itself anywhere as an attribute.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">

<div class="gmail_extra"><div class="gmail_quote"><div class="im"> <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra">

<div class="gmail_quote"></div><div class="gmail_quote">
1. It seems self.endpoint is a t.w.s.Site object. That's kind of confusing, since twisted has an "endpoint" concept that's one step removed from a Site (endpoints connect or listen with factories, a Site is a factory). You might want to reconsider that name :)<br>


</div></div></div></div></blockquote><div><br></div></div><div>Endpoint is the official name in draft: <a href="http://tools.ietf.org/html/draft-ietf-core-coap-18" target="_blank">http://tools.ietf.org/html/draft-ietf-core-coap-18</a>  I'll rename it to coap_endpoint to avoid confusion<br>


</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote">



</div><div class="gmail_quote">2. It's kind of strange to start with defer.succeed() and then start making a callback chain IMHO, but it's not wrong, really. <br></div></div></div></div></blockquote><div><br></div>


</div><div>I've recently understood callback chaining and I really like the idea. I guess it's this old proverb about having a hammer, and seeing nails everywhere. I'll try to come up with something better :) .<br>

</div></div></div></div></blockquote><div><br></div><div>No problem.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">

<div class="gmail_quote"><div>
</div><div>Case closed - thank you very much!<br></div></div></div></div></blockquote><div><br></div><div>Glad to have helped.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>Regards<br></div><div>Maciek<br></div></div></div></div></blockquote><div><br></div><div>cheers<br>lvh <br></div></div></div></div>