[Twisted-Python] Synchronous Wrapper for Deferreds

Eric Mangold teratorn at twistedmatrix.com
Sat Mar 19 01:05:40 EST 2005

Did anyone tell you about twisted.trial.util.deferredResult and

> A day or two ago, I inquired on IRC about making calls from an existing
> synchronous script. The script is not related to any Twisted activity,
> so minimal intervention was sort of a goal. Obviously this doesn't work
> on non-transient objects such as Perspective Broker ones, but here's
> what I came up with... (See attached) Obviously there is some cleaning
> up to do, but it demonstrates the idea.
> I have three questions: (1) I know this isn't the ideal way to use
> Twisted, but is there anything inherently problematic about my solution
> for one-off calls to Twisted. (2) I understand there are problems with
> running the same reactor twice. What are those problems and is there a
> recommended work around? (3) Are there any ideas on making a synchronous
> version of a Perspective Broker client to integrate into existing
> synchronous applications more easily?
> Thanks
> -Ken
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

More information about the Twisted-Python mailing list