[Twisted-Python] pyactivemq interfering with Twisted?
brianbaquiran at gmail.com
Wed Mar 19 00:23:57 EDT 2008
Valentino Volonghi wrote:
> On Wed, Mar 19, 2008 at 2:49 AM, Brian Baquiran <brianbaquiran at gmail.com> wrote:
>> The API does not block when using an async message listener as I'm doing.
>> Here's some example pyactivemq code that shows how an asynchronous message
>> listener is registered:
> This API actually blocks.
> Just by looking at:
> conn = f.createConnection()
> Which means that you can create a connection and immediately get the result.
> This is blocking by any relevant definition of blocking.
> Considering all of this you should probably use this from deferToThread.
I was able to fix my original problem by using reactor.callFromThread()
from the onMessage callback, so it does look like there is some
threading going on. I'll look where deferToThread should be applied.
Thanks Valentino. I really appreciate your looking at the code.
More information about the Twisted-Python