Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is SimpleXMLRPCServer single threaded? [duplicate]

Tags:

python

xml-rpc

Possible Duplicate:
Python XMLRPC with concurrent requests

I'm writing a python application which will act as xml-rpc server, using SimpleXMLRPCServer class.

Now my question is: what happens if 2 or more clients send a request at the same time? Are they queued? Do I have the guarantee that if two clients call the same or different functions they are executed one after another and not at the same time?

like image 758
Emiliano Avatar asked Jan 21 '23 11:01

Emiliano


2 Answers

I believe the library implementation of SimpleXMLRPCServer is indeed single-threaded. You have to add a mixin to make it serve requests in a multi-threaded way:

from SocketServer import ThreadingMixIn
from SimpleXMLRPCServer import SimpleXMLRPCServer

class MyXMLRPCServer(ThreadingMixIn, SimpleXMLRPCServer):
    """..."""
like image 198
Santa Avatar answered Jan 22 '23 23:01

Santa


If you just need your application to process XML-RPC requests (more than one at a time if needed) you may take a look at Pythomnic framework.

like image 36
Dmitry Dvoinikov Avatar answered Jan 23 '23 00:01

Dmitry Dvoinikov