I would really like to use the excellent zerorpc for my project that uses IronPython, but it doesn't seem to be supported.
I have tried downloading the zip of the source for zerorpc
and running
"C:\Program Files (x86)\IronPython 2.7\ipy.exe" setup.py install
but I see this along the way:
warning: build_py: byte-compiling is disabled, skipping.
This does not contradict the answer: Fast and scalable RPC between C# and CPython.
My question(s):
- Is it possible to get zerorpc running with IronPython and if so, please could you give me a hint of how to do it?
- If not, then are there any other equivalent packages that would provide the functionality in IronPython? There's a list here: What is the current choice for doing RPC in Python?, but does anyone know if any of these work with IronPython?
Update 2 Following @PawelJasinski suggestion and his updates to pyzmq ironpython-backend, I have tried the following:
- Installed IronPython 2.7.5b2 or later
- Installed 32 bit version of zeromq from http://zeromq.org/distro:microsoft-windows
- Clone
ironpython-backend
branch from https://github.com/paweljasinski/pyzmq/tree/ironpython-backend - In
pyzmq
dir, runipy.exe setup.py install --user
- Clone zerorpc from https://github.com/dotcloud/zerorpc-python
- In
zerorpc-python
, runipy.exe setup.py install --user
- Set the environment variable:
set PYZMQ_BACKEND=zmq.backend.ctypes
- Attempted to use the 'Cooler' class example from https://github.com/dotcloud/zerorpc-python, running with
ipy.exe -X:Frames cooler.py
(cooler.py):
class Cooler(object):
""" Various convenience methods to make things cooler. """
def add_man(self, sentence):
""" End a sentence with ", man!" to make it sound cooler, and
return the result. """
return sentence + ", man!"
def add_42(self, n):
""" Add 42 to an integer argument to make it cooler, and return the
result. """
return n + 42
def boat(self, sentence):
""" Replace a sentence with "I'm on a boat!", and return that,
because it's cooler. """
return "I'm on a boat!"
import zerorpc
s = zerorpc.Server(Cooler())
s.bind("tcp://0.0.0.0:4242")
s.run()
Now I see this error:
Traceback (most recent call last):
File "C:\Users\nlindop\AppData\Roaming\Python\IronPython27\site-packages\zmq\backend\select.py", line 26, in select_backend
File "C:\Users\nlindop\AppData\Roaming\Python\IronPython27\site-packages\zmq\backend\ctypes\__init__.py", line 26, in <module>
File "C:\Users\nlindop\AppData\Roaming\Python\IronPython27\site-packages\zmq\backend\ctypes\constants.py", line 16, in <module>
ImportError: No module named ZMQ