1

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.

Sam Hosseini
  • 813
  • 2
  • 9
  • 17
Petr Skocik
  • 58,047
  • 6
  • 95
  • 142
  • I have not tested full integration with python before but [This Article](http://www.decalage.info/python/ruby_bridge) offers some ideas for running Ruby in Python so the reverse should be applicable as well. Also there are a few libraries such as `RubyPython` and `rupy` that might be of some interest to you since this is such a limited use case. Beyond that you could compile the python into a `dll` or com and then use `Win32Api` or `Win32Ole` to handle the calls to the `dll`. – engineersmnky Apr 15 '15 at 13:22

1 Answers1

0

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.

Jason
  • 1,098
  • 12
  • 33