Re: [Twisted-Python] RPC design questions

2011-08-27 Thread Tobias Oberstein
Lefkowitz Gesendet: Dienstag, 23. August 2011 20:30 An: Twisted general discussion Betreff: Re: [Twisted-Python] RPC design questions On Aug 23, 2011, at 10:37 AM, Tobias Oberstein wrote: class AutobahnDeferred(Deferred): def call(self, *args): return self.addCallback(self.protocol.rcall

Re: [Twisted-Python] RPC design questions

2011-08-23 Thread Tobias Oberstein
self.call(procedure, arg) self.call(square, 6).addCallback(self.call, sqrt).addCallback(self.show) The easiest way to do this is probably: from functools import partial self.call(square, 6).addCallback(partial(self.call, sqrt)).addCallback(self.show) Thanks alot! Did not knew about

Re: [Twisted-Python] RPC design questions

2011-08-23 Thread Glyph Lefkowitz
On Aug 23, 2011, at 10:37 AM, Tobias Oberstein wrote: class AutobahnDeferred(Deferred): def call(self, *args): return self.addCallback(self.protocol.rcall, *args) Pro: most terse Con: only supports single callback no errback Con: subclassing in general is a bad idea.

Re: [Twisted-Python] RPC design questions

2011-08-23 Thread Tobias Oberstein
[mailto:twisted-python-boun...@twistedmatrix.com] Im Auftrag von Glyph Lefkowitz Gesendet: Dienstag, 23. August 2011 20:30 An: Twisted general discussion Betreff: Re: [Twisted-Python] RPC design questions On Aug 23, 2011, at 10:37 AM, Tobias Oberstein wrote: class AutobahnDeferred(Deferred

Re: [Twisted-Python] RPC design questions

2011-08-22 Thread Tristan Seligmann
On Mon, Aug 22, 2011 at 11:09 PM, Tobias Oberstein tobias.oberst...@tavendo.de wrote: self.call(procedure, arg) self.call(square, 6).addCallback(self.call, sqrt).addCallback(self.show) The easiest way to do this is probably: from functools import partial self.call(square,