本文整理汇总了Python中DocXMLRPCServer.DocXMLRPCServer.register_multicall_functions方法的典型用法代码示例。如果您正苦于以下问题:Python DocXMLRPCServer.register_multicall_functions方法的具体用法?Python DocXMLRPCServer.register_multicall_functions怎么用?Python DocXMLRPCServer.register_multicall_functions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocXMLRPCServer.DocXMLRPCServer
的用法示例。
在下文中一共展示了DocXMLRPCServer.register_multicall_functions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start
# 需要导入模块: from DocXMLRPCServer import DocXMLRPCServer [as 别名]
# 或者: from DocXMLRPCServer.DocXMLRPCServer import register_multicall_functions [as 别名]
def start( address, scheduler, debug=False ):
global count
if debug:
s = DocXMLRPCServer( address, allow_none=True )
s.register_introspection_functions()
else:
s = SimpleXMLRPCServer( address, allow_none=True )
handler = RPCHandler( scheduler )
s.register_multicall_functions()
s.register_instance( handler )
s.thread = threading.Thread( name="RPC", target=s.serve_forever )
s.thread.daemon = True
s.thread.start()
logging.info( "rpc interface started" )
return s, s.thread, handler
示例2: sumAndDifference
# 需要导入模块: from DocXMLRPCServer import DocXMLRPCServer [as 别名]
# 或者: from DocXMLRPCServer.DocXMLRPCServer import register_multicall_functions [as 别名]
#!/usr/bin/python
from DocXMLRPCServer import DocXMLRPCServer
def sumAndDifference(x,y):
"""This method returns sum and difference of arguments
as struct with two fields: 'sum' and 'difference'"""
return {'sum':x+y,'difference':x-y}
server = DocXMLRPCServer(("localhost", 5777))
server.register_function(sumAndDifference,"sample.sumAndDifference")
server.register_introspection_functions()
server.register_multicall_functions()
server.serve_forever()