Skip to content

How to bind multiple classes ? #265

@wangyan2048

Description

@wangyan2048

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions