搜尋

首頁  >  問答  >  主體

python - spyne编写soap协议的webservice,怎么样才能让接口支持多线程处理

我使用spyne库,编写了一个简单的soap协议是的webservice,但我的客户端使用了多线程,那服务端怎样才能支持多线程处理?请详细说明。
from spyne import Application, rpc, ServiceBase
from spyne import Integer, Unicode, Array, ComplexModel
from spyne.protocol.soap import Soap11
from spyne.server.wsgi import WsgiApplication
from wsgiref.simple_server import make_server

class SomeSampleServices(ServiceBase):

@rpc(Unicode, Unicode _returns=Unicode)  
def make_project(self, name, version):  
    print name
    print version  

if name == "__main__":

soap_app = Application([SomeSampleServices],  
                       'SampleServices',  
                       in_protocol=Soap11(validator="lxml"),  
                       out_protocol=Soap11())  
wsgi_app = WsgiApplication(soap_app)  
server = make_server(ip, port, wsgi_app)  

sys.exit(server.serve_forever())  
巴扎黑巴扎黑2787 天前1118

全部回覆(0)我來回復

無回覆
  • 取消回覆