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
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
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.
[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
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,