开发者

Is SimpleXMLRPCServer single threaded? [duplicate]

This question already has answers here: Closed 10 years ago.

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 o开发者_JAVA百科ne after another and not at the same time?


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):
    """..."""


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜