[Twisted-Python] Capture blocking calls?

Luc Stepniewski luc.stepniewski at adelux.fr
Thu Jun 16 04:51:24 EDT 2005

On Thursday 16 June 2005 10:18, Tommi Virtanen wrote:
> Luc Stepniewski wrote:
> > I've go tthe same difficulties here.  I'm trying to integrate into
> > Twisted a method (which comes from a python+C compiled module) that
> > returns data. The problem is that this method is blocking, so I can't
> > integrate it easily in Twisted.
> Sounds like you want to run twisted as normal and just call
> d = reactor.callInThread(bigUglyBlockingThing)
> when you want more stuff from it.

You're right, that's what I said I was doing. I was just making the point that 
it's easy to call methods from that thread using callFromThread(), but it's a 
pain to call a method which returns a deferred. Hopefully there's exarkun's 
ThreadWrapper (only in sandbox). Using this, I have some slowdown, but I'm 
not yet sure it's Twisted's fault.
So I was just asking if there was another way of doing it.


More information about the Twisted-Python mailing list