-
Notifications
You must be signed in to change notification settings - Fork 89
2.7 演示rpc模式,即客户端调用远程函数。
ydf0509 edited this page Apr 20, 2021
·
1 revision
from function_scheduling_distributed_framework import task_deco, BrokerEnum
@task_deco('test_rpc_queue', is_using_rpc_mode=True, broker_kind=BrokerEnum.REDIS_ACK_ABLE)
def add(a, b):
return a + b
if __name__ == '__main__':
add.consume()
from test_frame.test_rpc.test_consume import add
for i in range(100):
async_result = add.push(i, i * 2)
print(async_result.result)