<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thank you for the responses.&nbsp; Specifying the bound instance method as the callback works.&nbsp; (I remember it did not work for me many months ago, hence my post).&nbsp; Works now.<br><br>Thanks,<br>-Arun<br><br>--- On <b>Sat, 6/4/11, A Desai <i>&lt;ardesai@yahoo.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: A Desai &lt;ardesai@yahoo.com&gt;<br>Subject: Class methods as callbacks/errbacks<br>To: twisted-web@twistedmatrix.com<br>Date: Saturday, June 4, 2011, 9:31 PM<br><br><div id="yiv1809361855"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; -x-system-font: none;"
 valign="top">I use a wrapper functions as follows to specify the callback argument of addCallback() and addErrback().<br><br>def reqConnLostCallbk(result, arg_self):<br>&nbsp;&nbsp;&nbsp; arg_self.lost_conn()<br><br>def reqConnLostErrbk(failure, arg_self):<br>&nbsp;&nbsp;&nbsp; arg_self.lost_conn()<br><br><br>... inside a class method<br>&nbsp;&nbsp;&nbsp; d.addCallback(reqConnLostCallbk, self)<br>&nbsp;&nbsp;&nbsp; d.addErrback(reqConnLostErrbk, self)<br><br>&nbsp;&nbsp;&nbsp; def lost_conn(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // cleanup<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pass<br><br>Is there an alternative and/or cleaner solution to specify a class method as a callback or errback?<br><br>-Arun<br></td></tr></tbody></table></div></blockquote></td></tr></table>