Reputation: 2223
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):
Update 2 Following @PawelJasinski suggestion and his updates to pyzmq ironpython-backend, I have tried the following:
ironpython-backend
branch from https://github.com/paweljasinski/pyzmq/tree/ironpython-backendpyzmq
dir, run ipy.exe setup.py install --user
zerorpc-python
, run ipy.exe setup.py install --user
set PYZMQ_BACKEND=zmq.backend.ctypes
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
Upvotes: 3
Views: 777
Reputation: 796
For the second part of the question. pyro (and its dependency serpent) support IronPython and Jython.
Warning: stay away from IronPython 2.7.5b3 - it has a bug which breaks serpent. 2.7.4 and 2.7.5b2 are ok. Next 2.7.5 has a fix.
Upvotes: 2
Reputation: 796
ZeroRPC appears to be pure python and is based on pyzmq. In this case you can try pyzmq ctypes
backend for IronPython. https://github.com/paweljasinski/pyzmq/tree/ironpython-backend
ipy.exe setup.py install --user
. Install should detect your zmq and pick the right dllPYZMQ_BACKEND=zmq.backend.ctypes
UPDATE: ZeroRPC has dependency on gevent
which is not available under IronPython, so the above instructions are valid only for pyzmq under IronPython
Upvotes: 2