示例代码:
server端:
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(self, m, n):
""" Add 42 to an integer argument to make it cooler, and return the
result. """
return n + 42
#-----------------------------------------------------------------------------------
import zerorpc
s = zerorpc.Server(Cooler())
s.bind("tcp://0.0.0.0:9900")
s.run()
2.Client端:
$ zerorpc -j tcp://localhost:9900 add 42 1
43
3.github主页:https://github.com/dotcloud/zerorpc-python