[Twisted-Python] PB waitingForAnswers KeyError
ww at groovy.net
Sat Jul 23 01:33:45 EDT 2005
On Fri, Jul 22, 2005 at 02:19:25PM -1000, Bob Ippolito wrote:
> You've misunderstood what the example is trying to demonstrate, it is
> not a magical "invert twisted" box.
A magical "invert twisted" box... How about something like this?
def _i(f, *av, **kw)
e = Event()
result = 
d = maybeDeferred(f, *av, **kw)
reactor.callFromThread(_f, *av, **kw)
res = result
if isinstance(res, Exception):
def fooMethod(self, ...):
... do twisted stuff
fooMethod = invert(fooMethod)
Maybe with magic getattr functions it could be made completely
transparent... Not sure if it is worth the bother though.
If I am careful to do this sort of manipulation to protect potentially
dangerous code, it seems like the problems with pb disappear...
Thanks for your insight.
More information about the Twisted-Python