[Twisted-Python] Returning a Deferred as a result from another Deferred

David Reid dreid at dreid.org
Fri Oct 5 21:38:37 MDT 2007


On Oct 5, 2007, at 7:46 PM, Ryan Fugger wrote:
> What if I need to return a Deferred from a deferToThread?

That isn't really a "What if I" question, that's a "Why do you think  
you" question.

deferToThread is best used for taking uncontrollably blocking APIs  
(preferably C APIs that release GIL) and getting a Deferred back.  I  
personally can not think of a single reason why you would ever take a  
Deferred returning API and shuffle it off to a thread.

-David




More information about the Twisted-Python mailing list