So I have this server.
import zerorpc
class MyServer(object):
def method(self):
print("method is called")
return {'key': 'value'}
server = zerorpc.Server(MyServer(), heartbeat=None)
try:
zerorpc.gevent.spawn(server.run)
while True:
zerorpc.gevent.sleep(1)
except KeyboardInterrupt:
print("KeyboardInterrupt Received!")
server.close()
I run it with python2 `python2 s.py`
Then on a different terminal, I call the method with python3 virtual environment. And I get this result
(zerorpc) $ python3 ~/venv/zerorpc/bin/zerorpc tcp://0.0.0.0:9999 method {b'key': b'value'}
I expected this to be {'key': 'value'}. How can I get the expected value?
I have a workaround in place. I return everything in JSON encoded string. And then on the client-side, I decode it. But I really don't want to perform encoding myself as It's been done on the wire-level of zerorpc.
In python3 (3.6.3) I have these packages.
future==0.17.1
gevent==1.3.7
msgpack-python==0.5.6
pyzmq==17.1.0
zerorpc==0.6.1
In python2 (2.7.12) I have these
future==0.16.0
gevent==1.3.5
msgpack-python==0.5.6
pyzmq==17.1.0
zerorpc==0.6.1