[Twisted-Python] Reactor hangs on second call to reactor.run

Ed Manlove devPyPlTw at verizon.net
Wed Apr 18 20:19:58 MDT 2007


Jean-Paul Calderone wrote:
> On Wed, 18 Apr 2007 20:41:36 -0500, Ed Manlove <devpypltw at verizon.net> 
> wrote:
>> I am creating a Plone product which uses Twisted's nntp module to 
>> fetch newsgroup postings and display them within my Plone site.  
>> Within a Plone template I call the Plone External Method, 
>> XXXnewsreader. The first time I view the page containing this external 
>> method it runs fine but the second time it hangs.
>>
>> I've run the python debugger and it appears to be running an infinite 
>> loop within the function mainloop within the class PosixReactorBase.
>>
>> Can anyone share some ideas about what I may be doing wrong here or 
>> why the reactor appears to be stuck in the mainlop func?  Thanks for 
>> any assistance in advance.
>>
>> I am running under Windows XP using Twisted 2.5.0 and using Plone 
>> 2.1.3, Zope 2.8.7-final, python 2.3.5.
> 
> Starting reactors multiple times is not currently a supported feature.
> 
> Jean-Paul
> 

But is restarting the reactor supported?  I'm sorry if I was not clear 
but after the requested data is received I call reactor.stop() and 
return back to Plone/Zope engine. If later another request is made I 
will call the reactor.run(installSignalHandlers=0).  But again this will
only be done after a call to reactor.stop and within a different 
function call.

Does this matter or is this what mean by starting the reactor multiple 
times?

Ed





More information about the Twisted-Python mailing list