[Twisted-Python] callFromThread with return

Itamar Shtull-Trauring itamar at itamarst.org
Mon Oct 6 23:26:51 EDT 2003

On Mon, 06 Oct 2003 23:05:11 -0400
Glyph Lefkowitz <glyph at twistedmatrix.com> wrote:

> Andrew, can you add a bug to the tracker for this, and assign it to 
> someone? :)  It would also be good if it did handle Deferreds, but I'm
> a little sketchy on where the callback would go (I mean, you're in a 
> thread because you're blocking already, right?  but deferreds are to 
> avoid blocking, so does that mean the callback runs in a thread or in 
> the main loop?)

The callbacks all run the main thread, but the last one adds the result
to a object that feeds it to the waiting thread. That is, the thread
blocks until the Deferred has a result.

Itamar Shtull-Trauring    http://itamarst.org/
Available for Python & Twisted consulting

More information about the Twisted-Python mailing list