Chapter 13. Distributed Programming
Introduction
Credit: Jeremy Hylton, PythonLabs
The recipes in this chapter describe some simple techniques for using Python in distributed systems. Programming distributed systems is hard, and recipes alone won’t even come close to solving all your problems. What the recipes do is help you get programs on different computers talking to each other so you can start writing applications.
Remote procedure call (RPC) is an attractive approach to structuring a distributed system. The details of network communication are exposed through an interface that looks like normal procedure calls. When you call a function on a remote server, the RPC system is responsible for all the communication details. It encodes the arguments so they can be passed over the network to the server, which might use different internal representations for the data. It invokes the right function on the remote machine and waits for a response.
The recipes here use three different systems that provide RPC interfaces: CORBA, SOAP, and XML-RPC. These systems are attractive because they make it easy to connect programs, whether they are running on different computers or are written in different languages.
You can find Fredrik Lundh’s XML-RPC library for Python in the standard library, starting with the 2.2 release. For earlier versions of Python, and for CORBA and SOAP, you’ll need to install more software before you can get started. The recipes include pointers to the software you need. ...