All I want to do is make some RPC calls over sockets. I have a server that does backendish stuff running jython 2.5. I need to make some calls from a frontend server running Django on CPython. I've been beating my head against a wall getting any form of IPC going.
The list of things I've tried:
I know that it'd be a snap doing this with XML-RPC, which makes me even more cranky. I want to avoid the overhead of HTTP, but at the same time I really don't want to get down and dirty with sockets to implement my own protocol. I'll do it wrong if I do.
Any ideas? I'm probably going to cry for about 20 minutes and then just use XML-RPC.
Have you considered Hessian? From the blurb:
The Hessian binary web service protocol makes web services usable without requiring a large framework, and without learning yet another alphabet soup of protocols. Because it is a binary protocol, it is well-suited to sending binary data without any need to extend the protocol with attachments.
It has Python client and Java server (and more besides).
Update: If you're dead against HTTP, why not just use SocketServer
and pickle
? Not much of a protocol needed, hard to get wrong. Send / receive pickled strings with length prefixes.
How about using sockets, but with the help of asyncore
and asynchat
?
Some links:
Two that look the most interesting to me:
Gearman and Python bindings. It's quite a bit faster now that it's been re-written in C (originally perl). It's used in production (although I can't point to any examples of the python bindings being used in production). It has very interesting (to me) interfaces into MySQL and Postgresql. Finally, todays tweet from Django's Jacob Kaplan-Moss.
RabbitMQ although because it's just a message queue you'll still have to serialize your own messages unless you also use celery.
My favorite.. zeroc's ice
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With