We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server:
class A: @staticmethod def test_a(n): return n
class B: @staticmethod def test_b(n): return n * 2
server = zerorpc.Server() server.register(A(), 'a') server.register(B(), 'b')
server.bind("tcp://127.0.0.1:80") server.run()
client: client = zerorpc.Client() client.connect("tcp://127.0.0.1:80") print(client.a.test_a(1)) print(client.b.test_b(2))
The text was updated successfully, but these errors were encountered:
See the doc to expose one service: https://github.com/0rpc/zerorpc-python?tab=readme-ov-file#exposing-a-zeroservice-programmatically
Exposing multiple instances of classes can be done in two ways:
Sorry, something went wrong.
thx
No branches or pull requests
server:
class A:
@staticmethod
def test_a(n):
return n
class B:
@staticmethod
def test_b(n):
return n * 2
server = zerorpc.Server()
server.register(A(), 'a')
server.register(B(), 'b')
server.bind("tcp://127.0.0.1:80")
server.run()
client:
client = zerorpc.Client()
client.connect("tcp://127.0.0.1:80")
print(client.a.test_a(1))
print(client.b.test_b(2))
The text was updated successfully, but these errors were encountered: