[XML-SIG] Two SimpleXMLRPCServer questions
Mon, 10 Mar 2003 12:22:47 -0500
I have implemented a simple xmlrpc message queue (inspired heavily by the pyMQ
project on SourceForge--but don't bother going there, the code isn't posted
there yet, as it's pre-alpha.)
I use ZODB to store the queue data. I can't figure out how to pass the ZODB
file name in as a command parameter to the script. To paraphrase, the script
goes like this:
g_quit = 0 # isn't ASPN great?
if __name__ == '__main__':
db = 'somefile.fs'
server = SimpleXMLRPCServer()
while not g_quit:
The other question I have is how to make this server stop (and perhaps finish
it's work) when someone presses a control-C in the console.
BTW, the SimpleXMLRPCServer class is pretty amazing. I set up a queue of 1000
messages and was able to server 20 threads simultaneously issuing a
getMessagesFromTopic call without dropping a single connection. (Granted, I
cranked the request_queue_size from 5 to 200 ....) So far, no need for the
complexity of threads and locking ... :)