On 08:52 pm, [EMAIL PROTECTED] wrote:

>When I last looked at twisted (that is several years ago), there were
>several reactors - win32reactor, wxreactor, maybe even more.

Yes.  That's intentional.  Each of those systems offers its own event loop, and 
each reactor implements the basic operations in terms of those loops.

They all have the same API.  Application code does 'from twisted.internet 
import reactor; reactor.listenTCP', 'reactor.callLater', etc.  Only the very 
top-most level decides which reactor the application will use.

>And they
>didn't even work too well.  The problems I remember were that the win32reactor
>was limited to a only handful of handles, the wxreactor didn't process
>events when a wx modal dialog boy was displayed, and so on.  Has this changed?

win32eventreactor is limited to 64 handles because WaitForMultipleObjects is 
limited to 64 handles.  wxreactor's event loop is ghastly and actually did 
pause when a modal dialog box is displayed (that has since been fixed).  
Process support on win32 now works in the default select reactor as well as the 
gtk reactor, so win32reactor is mostly a curiosity at this point (useful mainly 
if you want to implement your own GDI-based GUI, as PyUI did at one point), and 
its limitations are not as serious for Twisted as a whole.

In other words, Twisted exposes the platform limitations in its 
platform-specific event loop implementations, and only works around them where 
it's possible to do so without masking platform functionality.

For servers, the epoll, poll, and select reactors work just fine.  The select 
reactor does have a maximum of FD_SETSIZE simultaneous sockets as well, but it 
is very easy to switch reactors if you need something more scalable.

For clients, the best GUI toolkit for Twisted applications at this point is 
GTK, but WX, QT and Cocoa can all be made to work with a minimum of hassle.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to