xmlrpc / SimpleXMLRPCServer and multi-threading

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marco Aschwanden

    xmlrpc / SimpleXMLRPCServer and multi-threading

    I would like to develop a server based on python's xmlrpc. But I
    realized that SimpleXMLRPCSer ver does not spawn a thread for each
    request.

    How could the SimpleXMLRPCSer ver be turned into a multi-threaded
    Server?
    Is there a reason why the SimpleXMLRPCSer ver is not multi-threaded?
    Is there a plan to make it multi-threaded?

    Thanks for any hints in advance,
    Cheers,
    Marco
  • vivek@cs.unipune.ernet.in

    #2
    Re: xmlrpc / SimpleXMLRPCSer ver and multi-threading

    On Mon, Dec 29, 2003 at 02:47:35AM -0800, Marco Aschwanden wrote:[color=blue]
    > I would like to develop a server based on python's xmlrpc. But I
    > realized that SimpleXMLRPCSer ver does not spawn a thread for each
    > request.
    >
    > How could the SimpleXMLRPCSer ver be turned into a multi-threaded
    > Server?
    > Is there a reason why the SimpleXMLRPCSer ver is not multi-threaded?
    > Is there a plan to make it multi-threaded?
    >
    > Thanks for any hints in advance,
    > Cheers,
    > Marco[/color]

    I had also faced the same problem some time ago. To use the SimpleXMLRPCSer ver as a multithreaded server, I just changed the SocketServer.TC PServer to SocketServer.Th readingTCPServe r in the definition of the SimpleXMLRPCSer ver class and it worked fine for me. But it was on Python 2.2 and I haven't tried on later versions.

    HTH,
    Vivek Kumar

    Comment

    • Shalabh Chaturvedi

      #3
      Re: xmlrpc / SimpleXMLRPCSer ver and multi-threading

      Marco Aschwanden wrote:[color=blue]
      > How could the SimpleXMLRPCSer ver be turned into a multi-threaded
      > Server?[/color]

      Look for ThreadingMixin in the SocketServer reference. You should be able to
      create a new class derived from both SimpleXMLRPCSer ver and ThreadingMixIn
      to achieve a thread-per-request server.

      --
      Shalabh

      Comment

      Working...