Distributed Computing
There are many standards for distributed computing, from simple Remote Procedure Call (RPC) ones to rich object-oriented ones such as CORBA. You can find many third-party Python modules that support these standards on the Internet.
The Python standard library supports both server and client use of a simple yet powerful standard known as XML-RPC. For in-depth coverage of XML-RPC, I recommend the book Programming Web Services with XML-RPC, by Simon St.Laurent and Joe Johnson (O’Reilly). XML-RPC uses HTTP or HTTPS as the underlying transport and encodes requests and replies in XML. For server-side support, see The Message Classes of the rfc822 and mimetools Modules. Client-side support is supplied by module xmlrpclib.
The xmlrcplib module supplies a class ServerProxy, which you instantiate to connect to an XML-RPC server. An instance s of ServerProxy is a proxy for the server it connects to: you call arbitrary methods on s, and s packages the method name and argument values as an XML-RPC request, sends the request to the XML-RPC server, receives the server’s response, and unpacks the response as the method’s result. The arguments to such method calls can be of any type supported by XML-RPC:
- Boolean
The built-in
boolconstantsTrueandFalse- Integers, floating-point numbers, strings, arrays
Passed and returned as Python
int,float,Unicode, andlistvalues- Structures
Passed and returned as Python
dictvalues whose keys must be strings- Dates
Passed as instances of class ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access