[Twisted-Python] Callback blocked in event loop
exarkun at divmod.com
Fri Nov 10 11:14:13 EST 2006
On Fri, 10 Nov 2006 15:24:51 +0000 (GMT), Matt P <twisted-list at zorinholdings.com> wrote:
>I've got a bit of an issue that someone may recognise and bea ble to set me
>Events may be raised in the server, as a twisted.pb call to fireEvent on the
>server and also come in on a separate thread (from a JMS message queue) and
>get posted onto the DefferedQueue for events.
>If events are raised in the server, remote listeners get their
>pb.Referenceable callback immediately. It works as I would like.
>So, only in the case where teh DeferredQueue.put(...) is called from another
>thread do I have the problem. I can't see why the blocking. Does this
>behaviour make sense to anyone!?
DeferredQueue isn't threadsafe. Instead of calling put() directly from a
non-reactor thread, call it with reactor.callFromThread:
More information about the Twisted-Python