SimpleXMLRPCServer and Threading

Jeff McNeil jeff at jmcneil.net
Wed Mar 28 22:45:39 CEST 2007


I do it this way and it's always worked great for me.

SimpleXMLRPCServer is based on SocketServer, so you can use the ForkingMixIn
or ThreadingMixIn classe to create something to handle requests in
parallel.

from SocketServer import ThreadingMixIn
import SimpleXMLRPCServer

class ThreadedXMLRPCServer(ThreadingMixIn, SimpleXMLRPCServer):
    """"My Threaded XMLRPC Server"""

You'll then use "ThreadedXMLRPCServer" when you instance your server object.

-Jeff



On 3/28/07, Achim Domma <domma at procoders.net> wrote:
>
> Hi,
>
> is SimpleXMLRPCServer multithreaded or how does it handle multiple
> clients? I want to implement a simple server which will be queried by
> multiple processes for work to be done. The server will simply hold a
> queue with files to process. The clients will ask for the next file.
>
> Do I have to sync access to the queue or is the server not threaded at
> all?
>
> regards,
> Achim
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070328/b428e741/attachment.html>


More information about the Python-list mailing list