[Twisted-Python] Deferred model

Philippe Lafoucrière lafou at wanadoo.fr
Thu Nov 13 16:14:16 EST 2003

> I'm sure this has been answered a million times before, but here goes...

I'm sure too. But I proposed a long time ago (and several times) to use
a forum instead of a mailing list... 

> Deferreds do not magically turn blocking code into non-blocking code. If
> you place blocking code in a wmfactory_ method, it will still interfere
> with the event loop.
> If you have blocking code, you can either rewrite it in a non-blocking
> manner, or you can use a separate thread to run it.
> <http://twistedmatrix.com/documents/howto/threading>
> If you give more detail about what you're trying to do, I'm sure one of
> the Twisted gurus can explain what the best approach(es) might be.

I thought of using the setUp method of page. I can start the calculation
when the page loads, but I don't know what to call (in the callback)
when it's done (a wmfactory_xxx ?). I'll check the threading part you
gave me. Thank you !


More information about the Twisted-Python mailing list