[Twisted-Python] Mimicking a blocking API using Twisted

Laurens Van Houtven _ at lvh.cc
Sun Mar 25 17:02:12 EDT 2012


Hi,


I'm trying to find out if there's a reasonable way to mimic a blocking API
with an existing non-blocking API. I want to do this so I can write
doctests.

For example, I want to make a remote AMP call. It returns a deferred.
Instead of returning a deferred, I want it to block until the deferred
fires.

The "obvious" way to do this would be to run the reactor in a different
thread. This would not be necessary if the reactor were restartable, but it
ain't.

I've found at least one mailing list issue where someone wanted something
similar, but did not see a resolution.

-- 
cheers
lvh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20120325/71b55044/attachment.htm 


More information about the Twisted-Python mailing list