MCPcopy Index your code
hub / github.com/python/cpython / system_multicall

Method system_multicall

Lib/xmlrpc/server.py:341–370  ·  view source on GitHub ↗

system.multicall([{'methodName': 'add', 'params': [2, 2]}, ...]) => \ [[4], ...] Allows the caller to package multiple XML-RPC calls into a single request. See http://www.xmlrpc.com/discuss/msgReader$1208

(self, call_list)

Source from the content-addressed store, hash-verified

339 return pydoc.getdoc(method)
340
341 def system_multicall(self, call_list):
342 """system.multicall([{'methodName': 'add', 'params': [2, 2]}, ...]) => \
343[[4], ...]
344
345 Allows the caller to package multiple XML-RPC calls into a single
346 request.
347
348 See http://www.xmlrpc.com/discuss/msgReader$1208
349 """
350
351 results = []
352 for call in call_list:
353 method_name = call['methodName']
354 params = call['params']
355
356 try:
357 # XXX A marshalling error in any response will fail the entire
358 # multicall. If someone cares they should fix this.
359 results.append([self._dispatch(method_name, params)])
360 except Fault as fault:
361 results.append(
362 {'faultCode' : fault.faultCode,
363 'faultString' : fault.faultString}
364 )
365 except BaseException as exc:
366 results.append(
367 {'faultCode' : 1,
368 'faultString' : "%s:%s" % (type(exc), exc)}
369 )
370 return results
371
372 def _dispatch(self, method, params):
373 """Dispatches the XML-RPC method.

Callers

nothing calls this directly

Calls 2

_dispatchMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected