Image

Python-based RPC Implementation

In case anyone else is interested, I recently explored the idea of building a simple RPC framework allowing clients to connect to a server and call a set of exported remote procedure methods on the server, passing (lists of) arbitrary objects as parameters and receiving the same in response (including the possibility of receiving an exception back from the server).

I know there are numerous packages available to do this sort of thing, but I wanted something a lot more efficient and easier to set up than SOAP, XML, or the other usual suspects: literally, a server being as simple as "here's a dictionary of functions to export, do it" and the client as "call function spam('eggs', 'sausage') on the server". Or nearly that simple, anyway.

I'm not sure what possessed me to take the next step, but I wrote down a more-or-less step-by-step description of how my RPC module was designed and how it works. If you're interested in bare-bones-simple Python RPC mechanisms, or just want to see yet another example of how a Python module was developed, feel free to read the posting about it from my journal.