
Here's my win32guireactor code, which at least for me, works better than win32eventreactor in my application. I have some problems in my app when using win32eventreactor: If the app displays a message box, no callLater calls are done (because a win32 messagebox has it's own event loop, and doIteration() is not called during this time. There are also other things that the user can do which shows the same behaviour, dragging a scrollbar for example. The second problem is that win32eventreactor uses a lot a cpu time - nearly 100% even on my brandnew 2GHz P4. Looks much like polling behaviour instead of event driven. So I wrote my own reactor implementation, which passes all events (those I've covered so far, reactor.callLater and network events) through a win32 message loop. Deferred's are not yet passed through the loop, so there is still some polling to be done. Looking at the comments at the top of the win32eventreactor code, my win32guireactor module shouldn't have the problems mentioned there. I post this module here asking for peer review and critical comments. This module requires win32all and my ctypes module as well, see the source for details. Thanks, Thomas PS: I tried to run unittests with this and other reactors with the command line py22 bin\trial -p twisted.test.test_internet -r <reactor> -v here are the results: default reactor FAILED (failures=5, errors=18) win32eventreactor twisted.test.test_ftp:FTPClientAndServerTests.testLongFileListings hangs forver. win32guireactor twisted.test.test_ftp:FTPClientAndServerTests.testLongFileListings crashes with this traceback, and then also hangs forever. twisted.test.test_ftp FTPClientAndServerTests testBadLogin ... testLongFileListings ... Traceback (most recent call last): File "C:\sf\Twisted\twisted\internet\win32guireactor.py", line 85, in __wm_timerevent tple.func(*tple.args, **tple.kw) File "C:\sf\Twisted\twisted\test\test_ftp.py", line 124, in errback except self.failureException, e: AttributeError: FTPClientAndServerTests instance has no attribute 'failureException'