[Pyobjc-dev] Twisted CFreactor consumes all available CPU
Brought to you by:
ronaldoussoren
From: James E. <ea...@ba...> - 2004-04-03 21:10:57
|
I'm not sure if this is really more appropriate to the twisted or pyobjc list, but hopefully this is the right place :-) I'm having trouble a PyObjC app using PyMacApp and Twisted -- When I run the application in an idle state (that is, the application just throws up a window and sits in the event loop, otherwise doing nothing), the application gobbles up all available CPU. Here's the offending __main__.py file: import twisted.internet.cfreactor reactor = twisted.internet.cfreactor.install() from PyObjCTools import NibClassBuilder, AppHelper import sys import MyAppController if __name__ == '__main__': AppHelper.runEventLoop() (Note that the controller provides an action that is performed when a button is pressed -- it invokes __main__.reactor.run() and __main__.reactor.connectTCP(...)) If I comment out those first two lines (that is, I never install the twisted cfreactor), then the application no longer gobbles up all available cpu (of course, this breaks the twisted integration with the event loop). Can anyone give any suggestions as to what I'm doing wrong here? Is this a bug with the Twisted CFReactor? I'm inclined to think it is since the Cocoa/SimpleWebClient example from the Twisted distribution does the same thing. Is there a workaround anyone can suggest? (BTW, this is stock Panther python 2.3 and Twisted 1.2.0). Thanks! James -- It is by caffeine alone that I put my mind in motion; It is by the leaves of tea that my thoughts acquire speed; The hands aquire shakes; the shakes become a warning; It is by caffeine alone I put my thoughts in motion. |