[Twisted-Python] Non returning deferred result.
cwellington at ccg.murdoch.edu.au
Fri Apr 18 03:47:29 EDT 2008
I certainly was calling it from the other thread! And that
callFromThread() certainly did fix my problem! :)
Thanks a heap!
On Fri, 2008-04-18 at 16:53 +1000, Andrew Bennetts wrote:
> Crispin Wellington wrote:
> > This DOES work except for a little strange behavoir. When the deferred
> > callback is triggered, the client doesn't see any response, the
> > connection just stays open. Then if I connect to the webservices from
> > anywhere, even a bad URL, I get my response suddenly back.
> > It's as if the callback is not triggered until some TCP activity cause
> > the main reactor to pump the pending requests or something. Is there
> I'm betting you are doing "deferred.callback(...)" from the thread. Twisted's
> APIs are in general *not* thread-safe. You should do
> "reactor.callFromThread(deferred.callback, ...)" instead. I suspect that will
> fix your problem.
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python