[Twisted-Python] synchronous/asynchronous api: possible interface

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Fri Nov 13 13:52:39 MST 2009


On 04:03 pm, doug.farrell at gmail.com wrote:
>Jean-Paul,
>
>Thanks for the "heads up", that certainly falls under the D'OH! 
>category. Would you have any suggestions for how I might do this kind 
>of thing?

I already mentioned SynchronousDeferred, so I guess you're not 
interested in that. :)

The main other idea that comes to mind is, in the synchronous case, to 
start the reactor in a separate thread and leave it running.  You can 
ask it to do things with reactor.callFromThread.  Or maybe you can use 
twisted.internet.threads.blockingCallFromThread.

Jean-Paul




More information about the Twisted-Python mailing list