[Twisted-Python] How to dispatch message to different servers

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Fri Mar 1 22:34:54 EST 2013


On 1 Mar, 09:52 pm, beenje at gmail.com wrote:
>Thanks for the answer!
>
>I was hoping to avoid having to put something like AMP in place, 
>because it looked a bit overkill for my case.
>I think I actually found a way :-)

Unfortunately, it looks like the code that you shared will only work 
accidentally (if at all).  You cannot use Twisted APIs except in the 
reactor thread.  You will at least need to add in some code to send data 
back to the reactor thread before you use Twisted APIs (such as 
`Deferred.callback`).

Jean-Paul



More information about the Twisted-Python mailing list