[Twisted-web] Reactor events help request ..

Watson, David David.Watson at windriver.com
Wed Feb 24 11:12:47 EST 2010

Hi Jean-Paul ..

Thanks for your response .. I think your correct, I got an earlier email
from Andrew, and he pointed me in the same direction ..
I am investigating this new info now and I think that this appears to be
the problem ..

Thanks for your help ..


Dave W.

-----Original Message-----
From: twisted-web-bounces at twistedmatrix.com
[mailto:twisted-web-bounces at twistedmatrix.com] On Behalf Of
exarkun at twistedmatrix.com
Sent: Wednesday, February 24, 2010 9:34 AM
To: Twisted Web World
Subject: Re: [Twisted-web] Reactor events help request ..

On 01:12 am, david.watson at windriver.com wrote:
>Hi Folks ..
>I'm not entirely a newbie a python and twisted, but I have come to the 
>point where I need a bit more expertise on this topic, so I am hoping 
>that I have come to the right place ..
>What  I'm hoping, that  you folks can help out with a minor problem 
>that I am having with the twistd reactor class and/or the callLater 
>I have been using a reactor.callLater function to schedule an event 
>that happens in the reactor to send out a heartbeat type message at 
>regular intervals .. This works great !
>However, it appears to me that the self.sendLine(msg)  and or the
>self.transport.write(msg) writing  functions are blocked functions 
>waiting for a reactor event to occur at a future scheduled time before 
>acutally flushing out the internal write buffers ..

This isn't the intended behavior.  The most common mistake which leads
to it is trying to use Twisted APIs such as these from a different
thread than the one where reactor.run() was called.  The only thread-
safe Twisted API is reactor.callFromThread.

You didn't say anything about threads in your post, so I don't know if
this is the problem you're having, but since it's so common I thought
I'd mention it.


Twisted-web mailing list
Twisted-web at twistedmatrix.com

More information about the Twisted-web mailing list