DRb -- Marshal via JSON to accommodate a non-ruby remote object

130 views Asked by At

I need communication between a couple of process types, most of which will be ruby processes, but a very important process type I'll need to communicate with will be a python process.

I came across DRb and I think it might be suitable for that as an alternative to using my own communication protocol.

I wonder, is there a straightforward way to accommodate the python process type.

The python process type would only need to respond to messages of the type message_id, *JSONifiable_params.

In other words, I'd like to do something like (in ruby):

python_server = DRbObject.new_with_uri(PYTHON_SERVER_URI, marshalling: :json)

and then in python, handle whatever JSON gets sent for the method calls I want it to support.

1

There are 1 answers

0
Jason On

We implemented the Ruby side of a JSON Drb server for the COSMOS command and control system here: json_drb.rb. We also have a Python interface which talks to that JSON Drb server at python-ballcosmos.