Just for fun - PickleRPC

Skip Montanaro skip at pobox.com
Thu Feb 27 21:53:17 CET 2003


Trying to speed up a simple client/server application in the spambayes world
I decided to try replacing XML-RPC with a simpler protocol.  I wound up with
an RPC protocol running over raw sockets which uses pickle as the
serialization format.  If you're curious about it, you can see PickleRPC and
a simple client/server pair here:

    http://manatee.mojam.com/~skip/python/PickleRPC.py
    http://manatee.mojam.com/~skip/python/hammiesrv.py
    http://manatee.mojam.com/~skip/python/hammiecli.py

Unless you are running the spambayes stuff already you won't actually be
able to run hammiesrv or hammiecli.  Still, they demonstrate how easy it can
be to create an RPC server - four lines for the server, three for the
client, including imports.  PickleRPC.py itself is less than 100 lines of
Python.

I'm sure this is just a toy - no real competition for xmlrpc, pyro or other
packages of that ilk, but it seems to work okay to the extent I've tested
it.

Skip





More information about the Python-list mailing list