[Twisted-Python] Folding the server into the client?

Don Dwiggins ddwiggins at advpubtech.com
Wed Sep 14 13:43:08 MDT 2011


I have an XMLRPC server which is currently accessed via both a web 
application and a desktop app (the latter uses wxPython as the UI).  I'm 
using subhandlers written as separate modules.

Now, I'd like to redo the desktop app to "fold in" one of the 
subhandlers to the application, so that it's called more directly, and 
to avoid the need to deal with a separate server (including the 
configuration issues).  I'll want to use the same subhandler source for 
both situations, to avoid the obvious duplication problems.  This means 
that I'll need to have the subhandler module "driven" by a reactor of 
some sort, to provide the needed deferred functionality to the 
subhandler.  (As a dividend for what I'm trying to do, I hope to 
leverage the asynchrony to keep the GUI from "freezing" while waiting 
for a response from the subhandler.)

It seems like I should be able to do this, but I'm having conceptual 
difficulties getting it all straight.  In the current setup, the client 
isn't using twisted, just the xmlrpclib.

I've learned a bit about wxreactor, and read 
http://wiki.wxpython.org/wxPythonAndTwisted.  It seems to me, as I 
understand it currently, that I'll need to have both a client and server 
reactor, and decide on a protocol between them that works in a 
single-process situation.  This leaves the question of the protocol and 
reactor types to use.

Or am I missing something important that would make things simpler (or 
maybe impossible)?

Thanks for any good words,
-- 

Don Dwiggins
Advanced Publishing Technology







More information about the Twisted-Python mailing list